函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:smack_mmap_file :* Check permissions for a mmap operation. The @file may be NULL, e.g.* if mapping anonymous memory.*@file contains the file structure for file to map (may be NULL).*@reqprot contains the protection requested by the application.

函数原型:static int smack_mmap_file(struct file *file, unsigned long reqprot, unsigned long prot, unsigned long flags)

返回类型:int

参数:

类型参数名称
struct file *file
unsigned longreqprot
unsigned longprot
unsigned longflags
1673  如果(file == NULL)则返回:0
1676  如果此条件成立可能性小(为编译器优化)(IS_PRIVATE(file_inode(file)))则返回:0
1679  isp等于smack_inode(file_inode(file))
1680  如果(label of the mmap domain == NULL)则返回:0
1682  sbsp等于s_security
1683  如果smk_flags按位与SMK_SB_UNTRUSTEDlabel of the mmap domain 不等于smk_root则返回:负EACCES
1686  mkp等于label of the mmap domain
1688  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.())
1689  skp等于Present a pointer to the smack label in the current task blob.
1690  rc等于0
1692  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1699  okp等于smk_object
1703  如果smk_known恒等于smk_known则继续下一循环
1709  may等于These functions are in smack_access.c
1712  如果may恒等于负ENOENTmay等于smk_access
1714  否则may与等于smk_access
1720  如果may恒等于0则继续下一循环
1728  mmay等于These functions are in smack_access.c
1730  如果mmay恒等于负ENOENT
1731  rc等于负EACCES
1732  退出
1738  tmay等于These functions are in smack_access.c
1740  如果tmay不等于负ENOENTmmay与等于tmay
1748  如果may按位或mmay的值不等于mmay
1749  rc等于负EACCES
1750  退出
1754  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1756  返回:rc