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()
718 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shm_more_checks()
759 ipc64_perm_to_ipc_perm(&in->shm_perm, &out.shm_perm); in copy_shmid_to_user()
790 out->shm_perm.uid = tbuf_old.shm_perm.uid; in copy_shmid_from_user()
791 out->shm_perm.gid = tbuf_old.shm_perm.gid; in copy_shmid_from_user()
792 out->shm_perm.mode = tbuf_old.shm_perm.mode; in copy_shmid_from_user()
877 shp = container_of(ipc, struct shmid_kernel, shm_perm); in shm_get_stat()
901 &shmid64->shm_perm, 0); in shmctl_down()
907 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in shmctl_down()
909 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_down()
915 ipc_lock_object(&shp->shm_perm); in shmctl_down()
920 ipc_lock_object(&shp->shm_perm); in shmctl_down()
921 err = ipc_update_perm(&shmid64->shm_perm, ipcp); in shmctl_down()
932 ipc_unlock_object(&shp->shm_perm); in shmctl_down()
1010 audit_ipc_obj(&shp->shm_perm); in shmctl_stat()
1013 if (ipcperms(ns, &shp->shm_perm, S_IRUGO)) in shmctl_stat()
1017 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_stat()
1021 ipc_lock_object(&shp->shm_perm); in shmctl_stat()
1023 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_stat()
1024 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1029 kernel_to_ipc64_perm(&shp->shm_perm, &tbuf->shm_perm); in shmctl_stat()
1054 err = shp->shm_perm.id; in shmctl_stat()
1057 ipc_unlock_object(&shp->shm_perm); in shmctl_stat()
1076 audit_ipc_obj(&(shp->shm_perm)); in shmctl_do_lock()
1077 err = security_shm_shmctl(&shp->shm_perm, cmd); in shmctl_do_lock()
1081 ipc_lock_object(&shp->shm_perm); in shmctl_do_lock()
1084 if (!ipc_valid_object(&shp->shm_perm)) { in shmctl_do_lock()
1092 if (!uid_eq(euid, shp->shm_perm.uid) && in shmctl_do_lock()
1093 !uid_eq(euid, shp->shm_perm.cuid)) { in shmctl_do_lock()
1111 if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) { in shmctl_do_lock()
1112 shp->shm_perm.mode |= SHM_LOCKED; in shmctl_do_lock()
1119 if (!(shp->shm_perm.mode & SHM_LOCKED)) in shmctl_do_lock()
1122 shp->shm_perm.mode &= ~SHM_LOCKED; in shmctl_do_lock()
1125 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1133 ipc_unlock_object(&shp->shm_perm); in shmctl_do_lock()
1215 struct compat_ipc_perm shm_perm; member
1293 to_compat_ipc64_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1308 to_compat_ipc_perm(&v.shm_perm, &in->shm_perm); in copy_compat_shmid_to_user()
1309 v.shm_perm.key = in->shm_perm.key; in copy_compat_shmid_to_user()
1327 return get_compat_ipc64_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1330 return get_compat_ipc_perm(&out->shm_perm, &p->shm_perm); in copy_compat_shmid_from_user()
1486 if (ipcperms(ns, &shp->shm_perm, acc_mode)) in do_shmat()
1489 err = security_shm_shmat(&shp->shm_perm, shmaddr, shmflg); in do_shmat()
1493 ipc_lock_object(&shp->shm_perm); in do_shmat()
1496 if (!ipc_valid_object(&shp->shm_perm)) { in do_shmat()
1497 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1514 ipc_unlock_object(&shp->shm_perm); in do_shmat()
1535 sfd->id = shp->shm_perm.id; in do_shmat()
1745 shp = container_of(ipcp, struct shmid_kernel, shm_perm); in sysvipc_shm_proc_show()
1758 shp->shm_perm.key, in sysvipc_shm_proc_show()
1759 shp->shm_perm.id, in sysvipc_shm_proc_show()
1760 shp->shm_perm.mode, in sysvipc_shm_proc_show()
1765 from_kuid_munged(user_ns, shp->shm_perm.uid), in sysvipc_shm_proc_show()
1766 from_kgid_munged(user_ns, shp->shm_perm.gid), in sysvipc_shm_proc_show()
1767 from_kuid_munged(user_ns, shp->shm_perm.cuid), in sysvipc_shm_proc_show()
1768 from_kgid_munged(user_ns, shp->shm_perm.cgid), in sysvipc_shm_proc_show()