Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\exec.c Create Date:2022-07-28 20:04:02
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bprm_fill_uid

Proto:static void bprm_fill_uid(struct linux_binprm *bprm)

Type:void

Parameter:

TypeParameterName
struct linux_binprm *bprm
1526  euid = current_euid()
1527  egid = current_egid()
1529  If Not mnt_may_suid(mnt) Then Return
1532  If task_no_new_privs(current process) Then Return
1535  inode = d_inode
1536  mode = READ_ONCE(i_mode)
1537  If Not (mode & (S_ISUID | S_ISGID)) Then Return
1541  inode_lock(inode)
1544  mode = i_mode
1545  uid = i_uid
1546  gid = i_gid
1547  inode_unlock(inode)
1550  If Not kuid_has_mapping(user_ns, uid) || Not kgid_has_mapping(user_ns, gid) Then Return
1554  If mode & S_ISUID Then
1555  per_clear |= Security-relevant compatibility flags that must be* cleared upon setuid or setgid exec:
1556  euid = uid
1559  If (mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP) Then
1560  per_clear |= Security-relevant compatibility flags that must be* cleared upon setuid or setgid exec:
1561  egid = gid
Caller
NameDescribe
prepare_binprmFill the binprm structure from the inode.* Check permissions, then read the first BINPRM_BUF_SIZE bytes* This may be called multiple times for binary chains (scripts for example).