Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_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().

Proto:struct tomoyo_domain_info *tomoyo_assign_domain(const char *domainname, const bool transit)

Type:struct tomoyo_domain_info

Parameter:

TypeParameterName
const char *domainname
const booltransit
527  struct tomoyo_domain_info e = {}
528  entry = moyo_find_domain - Find a domain by the given name.*@domainname: The domainname to find.* Returns pointer to "struct tomoyo_domain_info" if found, NULL otherwise.* Caller holds tomoyo_read_lock().
529  bool created = false
531  If entry Then
532  If transit Then
543  Return entry
547  If strlen - Find the length of a string*@s: The string to be sized >= TOMOYO_EXEC_TMPSIZE - 10 || Not tomoyo_correct_domain(domainname) Then Return NULL
555  If transit && moyo_namespace_jump - Check for namespace jump.*@domainname: Name of domain.* Returns true if namespace differs, false otherwise. Then Return NULL
557  Namespace for this domain. Never NULL. = 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().
558  If Not Namespace for this domain. Never NULL. Then Return NULL
565  If transit Then
566  domain = moyo_domain - Get "struct tomoyo_domain_info" for current thread.* Returns pointer to "struct tomoyo_domain_info" for current thread.
568  Profile number to use. = Profile number to use.
569  memcpy( Group numbers to use. , Group numbers to use. , size of Group numbers to use. )
571  Name of this domain. Never NULL. = tomoyo_get_name(domainname)
572  If Not Name of this domain. Never NULL. Then Return NULL
574  If mutex_lock_interruptible( & tomoyo_policy_lock) Then Go to out
576  entry = moyo_find_domain - Find a domain by the given name.*@domainname: The domainname to find.* Returns pointer to "struct tomoyo_domain_info" if found, NULL otherwise.* Caller holds tomoyo_read_lock().
577  If Not entry Then
578  entry = tomoyo_commit_ok( & e, size of e )
579  If entry Then
582  created = true
585  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.
586  out :
587  moyo_put_name - Drop reference on "struct tomoyo_name".*@name: Pointer to "struct tomoyo_path_info". Maybe NULL.* Returns nothing.
588  If entry && transit Then
589  If created Then
595  granted = false
605  Return entry
Caller
NameDescribe
tomoyo_find_next_domainmoyo_find_next_domain - Find a domain.*@bprm: Pointer to "struct linux_binprm".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
tomoyo_write_selfmoyo_write_self - write() for /sys/kernel/security/tomoyo/self_domain interface
tomoyo_write_domainmoyo_write_domain - Write domain policy.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().