Lines Matching refs:shm_perm
56 struct kern_ipc_perm shm_perm; member
100 ipc_unlock(&(shp)->shm_perm)
128 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in do_shm_rmid()
132 shp->shm_perm.mode |= SHM_DEST; in do_shm_rmid()
134 ipc_set_key_private(&shm_ids(ns), &shp->shm_perm); in do_shm_rmid()
176 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_obtain_object()
186 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_obtain_object_check()
211 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_lock()
228 ipc_lock_object(&ipcp->shm_perm); in shm_lock_by_ptr()
236 shm_perm); in shm_rcu_free()
237 security_shm_free(&shp->shm_perm); in shm_rcu_free()
277 ipc_rmid(&shm_ids(s->ns), &s->shm_perm); in shm_rmid()
345 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in shm_destroy()
362 (shp->shm_perm.mode & SHM_DEST)); in shm_may_destroy()
415 struct shmid_kernel *shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_try_destroy_orphaned()
496 WARN_ON(!ipc_rcu_getref(&shp->shm_perm)); in exit_shm()
519 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in exit_shm()
521 if (ipc_valid_object(&shp->shm_perm)) { in exit_shm()
729 shp->shm_perm.key = key; in newseg()
730 shp->shm_perm.mode = (shmflg & S_IRWXUGO); in newseg()
733 shp->shm_perm.security = NULL; in newseg()
734 error = security_shm_alloc(&shp->shm_perm); in newseg()
780 error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); in newseg()
794 file_inode(file)->i_ino = shp->shm_perm.id; in newseg()
797 error = shp->shm_perm.id; in newseg()
799 ipc_unlock_object(&shp->shm_perm); in newseg()
807 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in newseg()
810 call_rcu(&shp->shm_perm.rcu, shm_rcu_free); in newseg()
821 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_more_checks()
862 ipc64_perm_to_ipc_perm(&in->shm_perm, &out.shm_perm); in copy_shmid_to_user()
893 out->shm_perm.uid = tbuf_old.shm_perm.uid; in copy_shmid_from_user()
894 out->shm_perm.gid = tbuf_old.shm_perm.gid; in copy_shmid_from_user()
895 out->shm_perm.mode = tbuf_old.shm_perm.mode; in copy_shmid_from_user()
980 shp = container_of(ipc, struct shmid_kernel, shm_perm); in shm_get_stat()
1004 &shmid64->shm_perm, 0); in shmctl_down()
1010 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shmctl_down()
1012 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_down()
1018 ipc_lock_object(&shp->shm_perm); in shmctl_down()
1023 ipc_lock_object(&shp->shm_perm); in shmctl_down()
1024 err = ipc_update_perm(&shmid64->shm_perm, ipcp); in shmctl_down()
1035 ipc_unlock_object(&shp->shm_perm); in shmctl_down()
1113 audit_ipc_obj(&shp->shm_perm); in shmctl_stat()
1116 if (ipcperms(ns, &shp->shm_perm, S_IRUGO)) in shmctl_stat()
1120 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_stat()
1124 ipc_lock_object(&shp->shm_perm); in shmctl_stat()
1126 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_stat()
1127 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1132 kernel_to_ipc64_perm(&shp->shm_perm, &tbuf->shm_perm); in shmctl_stat()
1157 err = shp->shm_perm.id; in shmctl_stat()
1160 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1179 audit_ipc_obj(&(shp->shm_perm)); in shmctl_do_lock()
1180 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_do_lock()
1184 ipc_lock_object(&shp->shm_perm); in shmctl_do_lock()
1187 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_do_lock()
1195 if (!uid_eq(euid, shp->shm_perm.uid) && in shmctl_do_lock()
1196 !uid_eq(euid, shp->shm_perm.cuid)) { in shmctl_do_lock()
1214 if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) { in shmctl_do_lock()
1215 shp->shm_perm.mode |= SHM_LOCKED; in shmctl_do_lock()
1222 if (!(shp->shm_perm.mode & SHM_LOCKED)) in shmctl_do_lock()
1225 shp->shm_perm.mode &= ~SHM_LOCKED; in shmctl_do_lock()
1228 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1236 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1318 struct compat_ipc_perm shm_perm; member
1396 to_compat_ipc64_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1411 to_compat_ipc_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1412 v.shm_perm.key = in->shm_perm.key; in copy_compat_shmid_to_user()
1430 return get_compat_ipc64_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1433 return get_compat_ipc_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1589 if (ipcperms(ns, &shp->shm_perm, acc_mode)) in do_shmat()
1592 err = security_shm_shmat(&shp->shm_perm, shmaddr, shmflg); in do_shmat()
1596 ipc_lock_object(&shp->shm_perm); in do_shmat()
1599 if (!ipc_valid_object(&shp->shm_perm)) { in do_shmat()
1600 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1617 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1638 sfd->id = shp->shm_perm.id; in do_shmat()
1848 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in sysvipc_shm_proc_show()
1861 shp->shm_perm.key, in sysvipc_shm_proc_show()
1862 shp->shm_perm.id, in sysvipc_shm_proc_show()
1863 shp->shm_perm.mode, in sysvipc_shm_proc_show()
1868 from_kuid_munged(user_ns, shp->shm_perm.uid), in sysvipc_shm_proc_show()
1869 from_kgid_munged(user_ns, shp->shm_perm.gid), in sysvipc_shm_proc_show()
1870 from_kuid_munged(user_ns, shp->shm_perm.cuid), in sysvipc_shm_proc_show()
1871 from_kgid_munged(user_ns, shp->shm_perm.cgid), in sysvipc_shm_proc_show()