Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Rationale: code calling task_setscheduler, task_setioprio, and* task_setnice, assumes that*

Proto:static int cap_safe_nice(struct task_struct *p)

Type:int

Parameter:

TypeParameterName
struct task_struct *p
1085  ret = 0
1087  _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
1088  is_subset = Check if "a" is a subset of "set".* return true if ALL of the capabilities in "a" are also in "set"* cap_issubset(0101, 1111) will return true* return false if ANY of the capabilities in "a" are not in "set"* cap_issubset(1111, 0101) will return false
1090  If Not is_subset && Not ns_capable(user_ns, Allow setting cpu affinity on other processes ) Then ret = -EPERM
1092  _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()
1094  Return ret
Caller
NameDescribe
cap_task_setschedulerap_task_setscheduler - Detemine if scheduler policy change is permitted*@p: The task to affect* Detemine if the requested scheduler policy change is permitted for the* specified task, returning 0 if permission is granted, -ve if denied.
cap_task_setioprioap_task_ioprio - Detemine if I/O priority change is permitted*@p: The task to affect*@ioprio: The I/O priority to set* Detemine if the requested I/O priority change is permitted for the specified* task, returning 0 if permission is granted, -ve if denied.
cap_task_setniceap_task_ioprio - Detemine if task priority change is permitted*@p: The task to affect*@nice: The nice value to set* Detemine if the requested task priority change is permitted for the* specified task, returning 0 if permission is granted, -ve if denied.