Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\util.c Create Date:2022-07-28 16:39:51
Last Modify:2022-05-23 18:05:07 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pcperms - check ipc permissions*@ns: ipc namespace*@ipcp: ipc permission set*@flag: desired permission set* Check user, group, other permissions for access* to ipc resources. return 0 if allowed*@flag will most probably be 0 or ``S_

Proto:int ipcperms(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp, short flag)

Type:int

Parameter:

TypeParameterName
struct ipc_namespace *ns
struct kern_ipc_perm *ipcp
shortflag
521  euid = current_euid()
524  audit_ipc_obj(ipcp)
525  requested_mode = flag >> 6 | flag >> 3 | flag
526  granted_mode = mode
527  If uid_eq(euid, cuid) || uid_eq(euid, uid) Then granted_mode >>= 6
530  Else if in_group_p(cgid) || Check whether we're fsgid/egid or in the supplemental group.. Then granted_mode >>= 3
533  If requested_mode & ~granted_mode & 0007 && Not ns_capable(user_ns, Override IPC ownership checks ) Then Return -1
537  Return security_ipc_permission(ipcp, flag)
Caller
NameDescribe
ipc_check_permspc_check_perms - check security and permissions for an ipc object*@ns: ipc namespace*@ipcp: ipc permission set*@ops: the actual security routine to call*@params: its parameters* This routine is called by sys_msgget(), sys_semget() and sys_shmget()* when
msgctl_stat
do_msgsnd
do_msgrcv
semctl_stat
semctl_setval
semctl_main
do_semtimedop
shmctl_stat
do_shmatFix shmaddr, allocate descriptor, map shm, add attach descriptor to lists.* NOTE! Despite the name, this is NOT a direct system call entrypoint. The* "raddr" thing points to kernel space, and there has to be a wrapper around* this.