Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__devcgroup_check_permission - checks if an inode operation is permitted*@dev_cgroup: the dev cgroup to be tested against*@type: device type*@major: device major number*@minor: device minor number*@access: combination of DEVCG_ACC_WRITE, DEVCG_ACC_READ

Proto:static int __devcgroup_check_permission(short type, unsigned int major, unsigned int minor, short access)

Type:int

Parameter:

TypeParameterName
shorttype
unsigned intmajor
unsigned intminor
shortaccess
810  _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
811  dev_cgroup = task_devcgroup(current process)
812  If behavior == DEVCG_DEFAULT_ALLOW Then rc = Not match_exception_partial - iterates the exception list trying to find a partial match*@exceptions: list of exceptions*@type: device type (DEVCG_DEV_BLOCK or DEVCG_DEV_CHAR)*@major: device file major number, ~0 to match all*@minor: device file minor number,
816  Else rc = match_exception - iterates the exception list trying to find a complete match*@exceptions: list of exceptions*@type: device type (DEVCG_DEV_BLOCK or DEVCG_DEV_CHAR)*@major: device file major number, ~0 to match all*@minor: device file minor number, ~0 to
820  _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()
822  If Not rc Then Return -EPERM
825  Return 0
Caller
NameDescribe
devcgroup_check_permission