Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static int smack_mmap_file(struct file *file, unsigned long reqprot, unsigned long prot, unsigned long flags)

Type:int

Parameter:

TypeParameterName
struct file *file
unsigned longreqprot
unsigned longprot
unsigned longflags
1673  If (file == NULL) Then Return 0
1676  If Value for the false possibility is greater at compile time(IS_PRIVATE(file_inode(file))) Then Return 0
1679  isp = smack_inode(file_inode(file))
1680  If (label of the mmap domain == NULL) Then Return 0
1682  sbsp = s_security
1683  If smk_flags & SMK_SB_UNTRUSTED && label of the mmap domain != smk_root Then Return -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  If smk_known == smk_known Then Continue
1709  may = These functions are in smack_access.c
1712  If may == -ENOENT Then may = smk_access
1714  Else may &= smk_access
1720  If may == 0 Then Continue
1728  mmay = These functions are in smack_access.c
1730  If mmay == -ENOENT Then
1731  rc = -EACCES
1732  Break
1738  tmay = These functions are in smack_access.c
1740  If tmay != -ENOENT Then mmay &= tmay
1748  If (may | mmay) != mmay Then
1749  rc = -EACCES
1750  Break
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  Return rc