Lines Matching refs:shm_perm
54 struct kern_ipc_perm shm_perm; member
89 ipc_unlock(&(shp)->shm_perm)
117 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in do_shm_rmid()
120 shp->shm_perm.mode |= SHM_DEST; in do_shm_rmid()
122 ipc_set_key_private(&shm_ids(ns), &shp->shm_perm); in do_shm_rmid()
163 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_obtain_object()
173 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_obtain_object_check()
198 return container_of(ipcp, struct shmid_kernel, shm_perm); in shm_lock()
215 ipc_lock_object(&ipcp->shm_perm); in shm_lock_by_ptr()
223 shm_perm); in shm_rcu_free()
224 security_shm_free(&shp->shm_perm); in shm_rcu_free()
231 ipc_rmid(&shm_ids(ns), &s->shm_perm); in shm_rmid()
296 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in shm_destroy()
313 (shp->shm_perm.mode & SHM_DEST)); in shm_may_destroy()
356 struct shmid_kernel *shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_try_destroy_orphaned()
626 shp->shm_perm.key = key; in newseg()
627 shp->shm_perm.mode = (shmflg & S_IRWXUGO); in newseg()
630 shp->shm_perm.security = NULL; in newseg()
631 error = security_shm_alloc(&shp->shm_perm); in newseg()
679 error = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); in newseg()
689 file_inode(file)->i_ino = shp->shm_perm.id; in newseg()
692 error = shp->shm_perm.id; in newseg()
694 ipc_unlock_object(&shp->shm_perm); in newseg()
704 ipc_rcu_putref(&shp->shm_perm, shm_rcu_free); in newseg()
707 call_rcu(&shp->shm_perm.rcu, shm_rcu_free); in newseg()
719 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_more_checks()
760 ipc64_perm_to_ipc_perm(&in->shm_perm, &out.shm_perm); in copy_shmid_to_user()
791 out->shm_perm.uid = tbuf_old.shm_perm.uid; in copy_shmid_from_user()
792 out->shm_perm.gid = tbuf_old.shm_perm.gid; in copy_shmid_from_user()
793 out->shm_perm.mode = tbuf_old.shm_perm.mode; in copy_shmid_from_user()
878 shp = container_of(ipc, struct shmid_kernel, shm_perm); in shm_get_stat()
902 &shmid64->shm_perm, 0); in shmctl_down()
908 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shmctl_down()
910 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_down()
916 ipc_lock_object(&shp->shm_perm); in shmctl_down()
921 ipc_lock_object(&shp->shm_perm); in shmctl_down()
922 err = ipc_update_perm(&shmid64->shm_perm, ipcp); in shmctl_down()
933 ipc_unlock_object(&shp->shm_perm); in shmctl_down()
1011 audit_ipc_obj(&shp->shm_perm); in shmctl_stat()
1014 if (ipcperms(ns, &shp->shm_perm, S_IRUGO)) in shmctl_stat()
1018 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_stat()
1022 ipc_lock_object(&shp->shm_perm); in shmctl_stat()
1024 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_stat()
1025 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1030 kernel_to_ipc64_perm(&shp->shm_perm, &tbuf->shm_perm); in shmctl_stat()
1055 err = shp->shm_perm.id; in shmctl_stat()
1058 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1077 audit_ipc_obj(&(shp->shm_perm)); in shmctl_do_lock()
1078 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_do_lock()
1082 ipc_lock_object(&shp->shm_perm); in shmctl_do_lock()
1085 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_do_lock()
1093 if (!uid_eq(euid, shp->shm_perm.uid) && in shmctl_do_lock()
1094 !uid_eq(euid, shp->shm_perm.cuid)) { in shmctl_do_lock()
1112 if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) { in shmctl_do_lock()
1113 shp->shm_perm.mode |= SHM_LOCKED; in shmctl_do_lock()
1120 if (!(shp->shm_perm.mode & SHM_LOCKED)) in shmctl_do_lock()
1123 shp->shm_perm.mode &= ~SHM_LOCKED; in shmctl_do_lock()
1126 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1134 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1216 struct compat_ipc_perm shm_perm; member
1294 to_compat_ipc64_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1309 to_compat_ipc_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1310 v.shm_perm.key = in->shm_perm.key; in copy_compat_shmid_to_user()
1328 return get_compat_ipc64_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1331 return get_compat_ipc_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1488 if (ipcperms(ns, &shp->shm_perm, acc_mode)) in do_shmat()
1491 err = security_shm_shmat(&shp->shm_perm, shmaddr, shmflg); in do_shmat()
1495 ipc_lock_object(&shp->shm_perm); in do_shmat()
1498 if (!ipc_valid_object(&shp->shm_perm)) { in do_shmat()
1499 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1516 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1537 sfd->id = shp->shm_perm.id; in do_shmat()
1747 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in sysvipc_shm_proc_show()
1760 shp->shm_perm.key, in sysvipc_shm_proc_show()
1761 shp->shm_perm.id, in sysvipc_shm_proc_show()
1762 shp->shm_perm.mode, in sysvipc_shm_proc_show()
1767 from_kuid_munged(user_ns, shp->shm_perm.uid), in sysvipc_shm_proc_show()
1768 from_kgid_munged(user_ns, shp->shm_perm.gid), in sysvipc_shm_proc_show()
1769 from_kuid_munged(user_ns, shp->shm_perm.cuid), in sysvipc_shm_proc_show()
1770 from_kgid_munged(user_ns, shp->shm_perm.cgid), in sysvipc_shm_proc_show()