Lines Matching refs:shm_perm

54 	struct kern_ipc_perm	shm_perm;  member
98 ipc_unlock(&(shp)->shm_perm)
126 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in do_shm_rmid()
130 shp->shm_perm.mode |= SHM_DEST; in do_shm_rmid()
132 ipc_set_key_private(&shm_ids(ns), &shp->shm_perm); in do_shm_rmid()
173 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_obtain_object()
183 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_obtain_object_check()
208 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_lock()
225 ipc_lock_object(&ipcp->shm_perm); in shm_lock_by_ptr()
233 shm_perm); in shm_rcu_free()
234 security_shm_free(&shp->shm_perm); in shm_rcu_free()
274 ipc_rmid(&shm_ids(s->ns), &s->shm_perm); in shm_rmid()
342 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in shm_destroy()
359 (shp->shm_perm.mode & SHM_DEST)); in shm_may_destroy()
412 struct shmid_kernel *shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_try_destroy_orphaned()
490 WARN_ON(!ipc_rcu_getref(&shp->shm_perm)); in exit_shm()
513 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in exit_shm()
515 if (ipc_valid_object(&shp->shm_perm)) { in exit_shm()
731 shp->shm_perm.key = key; in newseg()
732 shp->shm_perm.mode = (shmflg & S_IRWXUGO); in newseg()
735 shp->shm_perm.security = NULL; in newseg()
736 error = security_shm_alloc(&shp->shm_perm); in newseg()
783 error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); in newseg()
797 file_inode(file)->i_ino = shp->shm_perm.id; in newseg()
800 error = shp->shm_perm.id; in newseg()
802 ipc_unlock_object(&shp->shm_perm); in newseg()
810 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in newseg()
813 call_rcu(&shp->shm_perm.rcu, shm_rcu_free); in newseg()
824 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_more_checks()
865 ipc64_perm_to_ipc_perm(&in->shm_perm, &out.shm_perm); in copy_shmid_to_user()
896 out->shm_perm.uid = tbuf_old.shm_perm.uid; in copy_shmid_from_user()
897 out->shm_perm.gid = tbuf_old.shm_perm.gid; in copy_shmid_from_user()
898 out->shm_perm.mode = tbuf_old.shm_perm.mode; in copy_shmid_from_user()
983 shp = container_of(ipc, struct shmid_kernel, shm_perm); in shm_get_stat()
1007 &shmid64->shm_perm, 0); in shmctl_down()
1013 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shmctl_down()
1015 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_down()
1021 ipc_lock_object(&shp->shm_perm); in shmctl_down()
1026 ipc_lock_object(&shp->shm_perm); in shmctl_down()
1027 err = ipc_update_perm(&shmid64->shm_perm, ipcp); in shmctl_down()
1038 ipc_unlock_object(&shp->shm_perm); in shmctl_down()
1116 audit_ipc_obj(&shp->shm_perm); in shmctl_stat()
1119 if (ipcperms(ns, &shp->shm_perm, S_IRUGO)) in shmctl_stat()
1123 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_stat()
1127 ipc_lock_object(&shp->shm_perm); in shmctl_stat()
1129 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_stat()
1130 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1135 kernel_to_ipc64_perm(&shp->shm_perm, &tbuf->shm_perm); in shmctl_stat()
1160 err = shp->shm_perm.id; in shmctl_stat()
1163 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1182 audit_ipc_obj(&(shp->shm_perm)); in shmctl_do_lock()
1183 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_do_lock()
1187 ipc_lock_object(&shp->shm_perm); in shmctl_do_lock()
1190 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_do_lock()
1198 if (!uid_eq(euid, shp->shm_perm.uid) && in shmctl_do_lock()
1199 !uid_eq(euid, shp->shm_perm.cuid)) { in shmctl_do_lock()
1217 if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) { in shmctl_do_lock()
1218 shp->shm_perm.mode |= SHM_LOCKED; in shmctl_do_lock()
1225 if (!(shp->shm_perm.mode & SHM_LOCKED)) in shmctl_do_lock()
1228 shp->shm_perm.mode &= ~SHM_LOCKED; in shmctl_do_lock()
1231 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1239 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1321 struct compat_ipc_perm shm_perm; member
1399 to_compat_ipc64_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1414 to_compat_ipc_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1415 v.shm_perm.key = in->shm_perm.key; in copy_compat_shmid_to_user()
1433 return get_compat_ipc64_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1436 return get_compat_ipc_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1592 if (ipcperms(ns, &shp->shm_perm, acc_mode)) in do_shmat()
1595 err = security_shm_shmat(&shp->shm_perm, shmaddr, shmflg); in do_shmat()
1599 ipc_lock_object(&shp->shm_perm); in do_shmat()
1602 if (!ipc_valid_object(&shp->shm_perm)) { in do_shmat()
1603 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1620 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1641 sfd->id = shp->shm_perm.id; in do_shmat()
1851 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in sysvipc_shm_proc_show()
1864 shp->shm_perm.key, in sysvipc_shm_proc_show()
1865 shp->shm_perm.id, in sysvipc_shm_proc_show()
1866 shp->shm_perm.mode, in sysvipc_shm_proc_show()
1871 from_kuid_munged(user_ns, shp->shm_perm.uid), in sysvipc_shm_proc_show()
1872 from_kgid_munged(user_ns, shp->shm_perm.gid), in sysvipc_shm_proc_show()
1873 from_kuid_munged(user_ns, shp->shm_perm.cuid), in sysvipc_shm_proc_show()
1874 from_kgid_munged(user_ns, shp->shm_perm.cgid), in sysvipc_shm_proc_show()