函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\shm.c Create Date:2022-07-27 18:23:05
Last Modify:2020-03-17 22:58:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:shmctl_do_lock

函数原型:static int shmctl_do_lock(struct ipc_namespace *ns, int shmid, int cmd)

返回类型:int

参数:

类型参数名称
struct ipc_namespace *ns
intshmid
intcmd
1070  _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
1071  shp等于shm_obtain_object_check(ns, shmid)
1072  如果是错误
1073  err等于错误
1074  转到:out_unlock1
1077  audit_ipc_obj( & (shm_perm))
1078  err等于security_shm_shmctl( & shm_perm, cmd)
1079  如果err则转到:out_unlock1
1082  ipc_lock_object( & shm_perm)
1085  如果非pc_valid_object() - helper to sort out IPC_RMID races for codepaths* where the respective ipc_ids.rwsem is not being held down.* Checks whether the ipc object is still around or if it's gone already, as
1086  err等于负EIDRM
1087  转到:out_unlock0
1090  如果非ns_capable(user_ns, Allow mlock and mlockall (which doesn't really have anything to dowith IPC) )则
1091  euid等于current_euid()
1093  如果非uid_eq(euid, uid)且非uid_eq(euid, cuid)则
1095  err等于负EPERM
1096  转到:out_unlock0
1098  如果cmd恒等于super user shmctl commands 且非rlimit(RLIMIT_MEMLOCK)则
1099  err等于负EPERM
1100  转到:out_unlock0
1104  shm_file等于shm_file
1105  如果is_file_hugepages(shm_file)则转到:out_unlock0
1108  如果cmd恒等于super user shmctl commands
1109  user等于current_user()
1111  err等于shmem_lock(shm_file, 1, user)
1112  如果非err且非mode按位与segment will not be swapped 的值则
1114  mlock_user等于user
1116  转到:out_unlock0
1120  如果非mode按位与segment will not be swapped 的值则转到:out_unlock0
1122  shmem_lock(shm_file, 0, mlock_user)
1123  mode与等于segment will not be swapped 的反
1124  mlock_user = NULL
1125  get_file(shm_file)
1126  ipc_unlock_object( & shm_perm)
1127  _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()
1128  shmem_unlock_mapping(f_mapping)
1130  fput(shm_file)
1131  返回:err
1133  out_unlock0 :
1134  ipc_unlock_object( & shm_perm)
1135  out_unlock1 :
1136  _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()
1137  返回:err
调用者
名称描述
ksys_shmctl
compat_ksys_shmctl