Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\smack\smack_lsm.c Create Date:2022-07-28 19:23:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:smack_setprocattr - Smack process attribute setting*@name: the name of the attribute in /proc/

Proto:static int smack_setprocattr(const char *name, void *value, size_t size)

Type:int

Parameter:

TypeParameterName
const char *name
void *value
size_tsize
3519  tsp = smack_cred(current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.())
3525  If Not smack_privileged(Allow MAC configuration or state changes) && list_empty - tests whether a list is empty*@head: the list to test. Then Return -EPERM
3528  If value == NULL || size == 0 || size >= SMK_LONGLABEL Then Return -EINVAL
3531  If strcmp(name, "current") != 0 Then Return -EINVAL
3534  skp = smk_import_entry(value, size)
3535  If IS_ERR(skp) Then Return PTR_ERR(skp)
3542  If skp == smack_known_web || skp == smack_known_star Then Return -EINVAL
3545  If Not smack_privileged(Allow MAC configuration or state changes) Then
3546  rc = -EPERM
3547  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(sklep, & transit allowed labels , list)
3548  If smk_label == skp Then
3549  rc = 0
3550  Break
3552  If rc Then Return rc
3556  new = prepare_creds - Prepare a new set of credentials for modification* Prepare a new set of task credentials for modification
3557  If (new == NULL) Then Return -ENOMEM
3560  tsp = smack_cred(new)
3561  label for access control = skp
3565  smk_destroy_label_list( & transit allowed labels )
3567  mmit_creds - Install new credentials upon the current task*@new: The credentials to be assigned* Install a new set of credentials to the current task, using RCU to replace* the old set. Both the objective and the subjective credentials pointers are
3568  Return size