Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ap_emulate_setxuid() fixes the effective / permitted capabilities of* a process after a call to setuid, setreuid, or setresuid.* 1) When set*uiding _from_ one of {r,e,s}uid == 0 _to_ all of* {r,e,s}uid != 0, the permitted and effective capabilities are

Proto:static inline void cap_emulate_setxuid(struct cred *new, const struct cred *old)

Type:void

Parameter:

TypeParameterName
struct cred *new
const struct cred *old
999  root_uid = make_kuid - Map a user-namespace uid pair into a kuid
1001  If ( uid_eq( real UID of the task , root_uid) || uid_eq( effective UID of the task , root_uid) || uid_eq( saved UID of the task , root_uid)) && Not uid_eq( real UID of the task , root_uid) && Not uid_eq( effective UID of the task , root_uid) && Not uid_eq( saved UID of the task , root_uid) Then
1017  cap_clear( Ambient capability set )
1019  If uid_eq( effective UID of the task , root_uid) && Not uid_eq( effective UID of the task , root_uid) Then cap_clear( caps we can actually use )
1021  If Not uid_eq( effective UID of the task , root_uid) && uid_eq( effective UID of the task , root_uid) Then caps we can actually use = caps we're permitted
Caller
NameDescribe
cap_task_fix_setuidap_task_fix_setuid - Fix up the results of setuid() call*@new: The proposed credentials*@old: The current task's current credentials*@flags: Indications of what has changed* Fix up the results of setuid() call before the credential changes are