函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\common.c Create Date:2022-07-27 21:03:33
Last Modify:2020-03-18 09:15:18 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:moyo_assign_profile - Create a new profile.*@ns: Pointer to "struct tomoyo_policy_namespace".*@profile: Profile number to create.* Returns pointer to "struct tomoyo_profile" on success, NULL otherwise.

函数原型:static struct tomoyo_profile *tomoyo_assign_profile(struct tomoyo_policy_namespace *ns, const unsigned int profile)

返回类型:struct tomoyo_profile

参数:

类型参数名称
struct tomoyo_policy_namespace *ns
const unsigned intprofile
496  如果profile大于等于Profile number is an integer between 0 and 255. 则返回:NULL
498  ptr等于 Profile table. Memory is allocated as needed. [profile]
499  如果ptr则返回:ptr
501  entry等于分配内存并置零
502  如果mutex_lock_interruptible( & tomoyo_policy_lock)则转到:out
504  ptr等于 Profile table. Memory is allocated as needed. [profile]
505  如果非ptrtomoyo_memory_ok(entry)则
506  ptr等于entry
507  default_config等于TOMOYO_CONFIG_DISABLED按位或TOMOYO_CONFIG_WANT_GRANT_LOG按位或TOMOYO_CONFIG_WANT_REJECT_LOG
510  memset(config, TOMOYO_CONFIG_USE_DEFAULT, config的长度)
512  pref[TOMOYO_PREF_MAX_AUDIT_LOG]等于CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG
514  pref[TOMOYO_PREF_MAX_LEARNING_ENTRY]等于CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY
516  Force strict CPU ordering.* And yes, this might be required on UP too when we're talking* to devices.()
517  Profile table. Memory is allocated as needed. [profile]等于ptr
518  entry = NULL
520  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.
521  out :
522  释放内存
523  返回:ptr
调用者
名称描述
tomoyo_write_profilemoyo_write_profile - Write profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.