函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\util.c Create Date:2022-07-27 18:15:10
Last Modify:2022-05-23 18:05:07 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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_

函数原型:int ipcperms(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp, short flag)

返回类型:int

参数:

类型参数名称
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  如果uid_eq(euid, cuid)或uid_eq(euid, uid)则granted_mode右移等于6位
530  否则如果in_group_p(cgid)或Check whether we're fsgid/egid or in the supplemental group..granted_mode右移等于3位
533  如果requested_mode按位与granted_mode的反按位与0007且非ns_capable(user_ns, Override IPC ownership checks )则返回:负1
537  返回:security_ipc_permission(ipcp, flag)
调用者
名称描述
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.