Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\domain.c Create Date:2022-07-28 19:40:01
Last Modify:2022-05-23 20:14:46 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:moyo_assign_namespace - Create a new namespace.*@domainname: Name of namespace to create.* Returns pointer to "struct tomoyo_policy_namespace" on success,* NULL otherwise.* Caller holds tomoyo_read_lock().

Proto:struct tomoyo_policy_namespace *tomoyo_assign_namespace(const char *domainname)

Type:struct tomoyo_policy_namespace

Parameter:

TypeParameterName
const char *domainname
466  cp = domainname
467  len = 0
469  When cp && cp++ != ' ' cycle
470  len++
471  ptr = moyo_find_namespace - Find specified namespace.*@name: Name of namespace to find.*@len: Length of @name.* Returns pointer to "struct tomoyo_policy_namespace" if found,* NULL otherwise.* Caller holds tomoyo_read_lock().
472  If ptr Then Return ptr
474  If len >= TOMOYO_EXEC_TMPSIZE - 10 || Not tomoyo_domain_def(domainname) Then Return NULL
476  entry = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
477  If Not entry Then Return NULL
479  If mutex_lock_interruptible( & tomoyo_policy_lock) Then Go to out
481  ptr = moyo_find_namespace - Find specified namespace.*@name: Name of namespace to find.*@len: Length of @name.* Returns pointer to "struct tomoyo_policy_namespace" if found,* NULL otherwise.* Caller holds tomoyo_read_lock().
482  If Not ptr && tomoyo_memory_ok(entry) Then
483  name = entry + 1
485  ptr = entry
486  memmove(name, domainname, len)
487  name[len] = '\0'
488  Name of this namespace (e.g. "", "" ). = name
489  moyo_init_policy_namespace - Initialize namespace.*@ns: Pointer to "struct tomoyo_policy_namespace".* Returns nothing.
490  entry = NULL
492  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
493  out :
494  kfree(entry)
495  Return ptr
Caller
NameDescribe
tomoyo_assign_domainmoyo_assign_domain - Create a domain or a namespace.*@domainname: The name of domain.*@transit: True if transit to domain found or created.* Returns pointer to "struct tomoyo_domain_info" on success, NULL otherwise.* Caller holds tomoyo_read_lock().
tomoyo_parse_policymoyo_parse_policy - Parse a policy line.*@head: Poiter to "struct tomoyo_io_buffer".*@line: Line to parse.* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().