函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Rationale: code calling task_setscheduler, task_setioprio, and* task_setnice, assumes that*

函数原型:static int cap_safe_nice(struct task_struct *p)

返回类型:int

参数:

类型参数名称
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  如果非is_subset且非ns_capable(user_ns, Allow setting cpu affinity on other processes )则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  返回:ret
调用者
名称描述
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.