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()
339 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in shm_destroy()
356 (shp->shm_perm.mode & SHM_DEST)); in shm_may_destroy()
399 struct shmid_kernel *shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_try_destroy_orphaned()
477 WARN_ON(!ipc_rcu_getref(&shp->shm_perm)); in exit_shm()
500 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in exit_shm()
502 if (ipc_valid_object(&shp->shm_perm)) { in exit_shm()
718 shp->shm_perm.key = key; in newseg()
719 shp->shm_perm.mode = (shmflg & S_IRWXUGO); in newseg()
722 shp->shm_perm.security = NULL; in newseg()
723 error = security_shm_alloc(&shp->shm_perm); in newseg()
771 error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); in newseg()
785 file_inode(file)->i_ino = shp->shm_perm.id; in newseg()
788 error = shp->shm_perm.id; in newseg()
790 ipc_unlock_object(&shp->shm_perm); in newseg()
800 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in newseg()
803 call_rcu(&shp->shm_perm.rcu, shm_rcu_free); in newseg()
814 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_more_checks()
855 ipc64_perm_to_ipc_perm(&in->shm_perm, &out.shm_perm); in copy_shmid_to_user()
886 out->shm_perm.uid = tbuf_old.shm_perm.uid; in copy_shmid_from_user()
887 out->shm_perm.gid = tbuf_old.shm_perm.gid; in copy_shmid_from_user()
888 out->shm_perm.mode = tbuf_old.shm_perm.mode; in copy_shmid_from_user()
973 shp = container_of(ipc, struct shmid_kernel, shm_perm); in shm_get_stat()
997 &shmid64->shm_perm, 0); in shmctl_down()
1003 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shmctl_down()
1005 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_down()
1011 ipc_lock_object(&shp->shm_perm); in shmctl_down()
1016 ipc_lock_object(&shp->shm_perm); in shmctl_down()
1017 err = ipc_update_perm(&shmid64->shm_perm, ipcp); in shmctl_down()
1028 ipc_unlock_object(&shp->shm_perm); in shmctl_down()
1106 audit_ipc_obj(&shp->shm_perm); in shmctl_stat()
1109 if (ipcperms(ns, &shp->shm_perm, S_IRUGO)) in shmctl_stat()
1113 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_stat()
1117 ipc_lock_object(&shp->shm_perm); in shmctl_stat()
1119 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_stat()
1120 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1125 kernel_to_ipc64_perm(&shp->shm_perm, &tbuf->shm_perm); in shmctl_stat()
1150 err = shp->shm_perm.id; in shmctl_stat()
1153 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1172 audit_ipc_obj(&(shp->shm_perm)); in shmctl_do_lock()
1173 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_do_lock()
1177 ipc_lock_object(&shp->shm_perm); in shmctl_do_lock()
1180 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_do_lock()
1188 if (!uid_eq(euid, shp->shm_perm.uid) && in shmctl_do_lock()
1189 !uid_eq(euid, shp->shm_perm.cuid)) { in shmctl_do_lock()
1207 if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) { in shmctl_do_lock()
1208 shp->shm_perm.mode |= SHM_LOCKED; in shmctl_do_lock()
1215 if (!(shp->shm_perm.mode & SHM_LOCKED)) in shmctl_do_lock()
1218 shp->shm_perm.mode &= ~SHM_LOCKED; in shmctl_do_lock()
1221 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1229 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1311 struct compat_ipc_perm shm_perm; member
1389 to_compat_ipc64_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1404 to_compat_ipc_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1405 v.shm_perm.key = in->shm_perm.key; in copy_compat_shmid_to_user()
1423 return get_compat_ipc64_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1426 return get_compat_ipc_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1582 if (ipcperms(ns, &shp->shm_perm, acc_mode)) in do_shmat()
1585 err = security_shm_shmat(&shp->shm_perm, shmaddr, shmflg); in do_shmat()
1589 ipc_lock_object(&shp->shm_perm); in do_shmat()
1592 if (!ipc_valid_object(&shp->shm_perm)) { in do_shmat()
1593 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1610 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1631 sfd->id = shp->shm_perm.id; in do_shmat()
1842 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in sysvipc_shm_proc_show()
1855 shp->shm_perm.key, in sysvipc_shm_proc_show()
1856 shp->shm_perm.id, in sysvipc_shm_proc_show()
1857 shp->shm_perm.mode, in sysvipc_shm_proc_show()
1862 from_kuid_munged(user_ns, shp->shm_perm.uid), in sysvipc_shm_proc_show()
1863 from_kgid_munged(user_ns, shp->shm_perm.gid), in sysvipc_shm_proc_show()
1864 from_kuid_munged(user_ns, shp->shm_perm.cuid), in sysvipc_shm_proc_show()
1865 from_kgid_munged(user_ns, shp->shm_perm.cgid), in sysvipc_shm_proc_show()