函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\smack\smackfs.c Create Date:2022-07-27 20:56:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:smk_set_cipso - do the work for write() for cipso and cipso2*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start*@format: /smack/cipso or /smack/cipso2

函数原型:static ssize_t smk_set_cipso(struct file *file, const char __user *buf, size_t count, loff_t *ppos, int format)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
const char __user *buf
size_tcount
loff_t *ppos
intformat
840  rc等于负EINVAL
841  char * data = NULL
851  如果非smack_privileged - are all privilege requirements met*@cap: The requested capability* Is the task privileged and allowed to be privileged* by the onlycap rule.* Returns true if the task is allowed to be privileged, false if it's not.则返回:负EPERM
853  如果ppos不等于0则返回:负EINVAL
855  如果format恒等于Fixed 24byte label format count小于SMK_CIPSOMINcount大于SMK_CIPSOMAX的值则返回:负EINVAL
859  data等于memdup_user_nul - duplicate memory region from user space and NUL-terminate*@src: source address in user space*@len: number of bytes to copy* Return: an ERR_PTR() on failure.
860  如果是错误则返回:错误
863  rule等于data
868  mutex_lock( & List locks)
870  skp等于smk_import_entry - import a label, return the list entry*@string: a text string that might be a Smack label*@len: the maximum size, or zero if it is NULL terminated
871  如果是错误
872  rc等于错误
873  转到:out
876  如果format恒等于Fixed 24byte label format rule加等于Smack labels were limited to 23 characters for a long time.
878  否则rule加等于strlen - Find the length of a string*@s: The string to be sized加1
881  ret等于sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments
882  如果ret不等于1或maplevel大于CIPSO 2.2 standard 则转到:out
885  rule加等于Values for parsing cipso rules* SMK_DIGITLEN: Length of a digit field in a rule.* SMK_CIPSOMIN: Minimum possible cipso rule length.* SMK_CIPSOMAX: Maximum possible cipso rule length.
886  ret等于sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments
887  如果ret不等于1或catlen大于23 * 8 则转到:out
890  如果format恒等于Fixed 24byte label format count不等于SMK_CIPSOMINcatlenValues for parsing cipso rules* SMK_DIGITLEN: Length of a digit field in a rule.* SMK_CIPSOMIN: Minimum possible cipso rule length.* SMK_CIPSOMAX: Maximum possible cipso rule length.则转到:out
894  memset(mapcatset, 0, mapcatset的长度)
896 i小于catlen循环
897  rule加等于Values for parsing cipso rules* SMK_DIGITLEN: Length of a digit field in a rule.* SMK_CIPSOMIN: Minimum possible cipso rule length.* SMK_CIPSOMAX: Maximum possible cipso rule length.
898  ret等于sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments
899  如果ret不等于1或cat大于23 * 8 则转到:out
902  Stricly for CIPSO level manipulation.* Set the category bit number in a smack label sized buffer.
905  rc等于smk_netlbl_mls - convert a catset to netlabel mls categories*@catset: the Smack categories*@sap: where to put the netlabel categories* Allocates and fills attr.mls* Returns 0 on success, error code on failure.
906  如果rc大于等于0则
907  lbl_catmap_free - Free a LSM secattr catmap*@catmap: the category bitmap* Description:* Free a LSM secattr catmap.
908  cat等于cat
909  lvl等于lvl
910  rc等于count
913  out :
914  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.
915  释放内存
916  返回:rc
调用者
名称描述
smk_write_cipsosmk_write_cipso - write() for /smack/cipso*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start* Accepts only one cipso rule per write call
smk_write_cipso2smk_write_cipso2 - write() for /smack/cipso2*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start* Accepts only one cipso rule per write call