Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\common.c Create Date:2022-07-28 19:34:15
Last Modify:2020-03-18 09:15:18 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static struct tomoyo_profile *tomoyo_assign_profile(struct tomoyo_policy_namespace *ns, const unsigned int profile)

Type:struct tomoyo_profile

Parameter:

TypeParameterName
struct tomoyo_policy_namespace *ns
const unsigned intprofile
496  If profile >= Profile number is an integer between 0 and 255. Then Return NULL
498  ptr = Profile table. Memory is allocated as needed. [profile]
499  If ptr Then Return ptr
501  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).
502  If mutex_lock_interruptible( & tomoyo_policy_lock) Then Go to out
504  ptr = Profile table. Memory is allocated as needed. [profile]
505  If Not ptr && tomoyo_memory_ok(entry) Then
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, size of 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  kfree(entry)
523  Return ptr
Caller
NameDescribe
tomoyo_write_profilemoyo_write_profile - Write profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.