diff options
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 8644d864e3c1..cce994e9fc0a 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -5767,53 +5767,53 @@ static int selinux_shm_shmat(struct shmid_kernel *shp, | |||
5767 | } | 5767 | } |
5768 | 5768 | ||
5769 | /* Semaphore security operations */ | 5769 | /* Semaphore security operations */ |
5770 | static int selinux_sem_alloc_security(struct sem_array *sma) | 5770 | static int selinux_sem_alloc_security(struct kern_ipc_perm *sma) |
5771 | { | 5771 | { |
5772 | struct ipc_security_struct *isec; | 5772 | struct ipc_security_struct *isec; |
5773 | struct common_audit_data ad; | 5773 | struct common_audit_data ad; |
5774 | u32 sid = current_sid(); | 5774 | u32 sid = current_sid(); |
5775 | int rc; | 5775 | int rc; |
5776 | 5776 | ||
5777 | rc = ipc_alloc_security(&sma->sem_perm, SECCLASS_SEM); | 5777 | rc = ipc_alloc_security(sma, SECCLASS_SEM); |
5778 | if (rc) | 5778 | if (rc) |
5779 | return rc; | 5779 | return rc; |
5780 | 5780 | ||
5781 | isec = sma->sem_perm.security; | 5781 | isec = sma->security; |
5782 | 5782 | ||
5783 | ad.type = LSM_AUDIT_DATA_IPC; | 5783 | ad.type = LSM_AUDIT_DATA_IPC; |
5784 | ad.u.ipc_id = sma->sem_perm.key; | 5784 | ad.u.ipc_id = sma->key; |
5785 | 5785 | ||
5786 | rc = avc_has_perm(sid, isec->sid, SECCLASS_SEM, | 5786 | rc = avc_has_perm(sid, isec->sid, SECCLASS_SEM, |
5787 | SEM__CREATE, &ad); | 5787 | SEM__CREATE, &ad); |
5788 | if (rc) { | 5788 | if (rc) { |
5789 | ipc_free_security(&sma->sem_perm); | 5789 | ipc_free_security(sma); |
5790 | return rc; | 5790 | return rc; |
5791 | } | 5791 | } |
5792 | return 0; | 5792 | return 0; |
5793 | } | 5793 | } |
5794 | 5794 | ||
5795 | static void selinux_sem_free_security(struct sem_array *sma) | 5795 | static void selinux_sem_free_security(struct kern_ipc_perm *sma) |
5796 | { | 5796 | { |
5797 | ipc_free_security(&sma->sem_perm); | 5797 | ipc_free_security(sma); |
5798 | } | 5798 | } |
5799 | 5799 | ||
5800 | static int selinux_sem_associate(struct sem_array *sma, int semflg) | 5800 | static int selinux_sem_associate(struct kern_ipc_perm *sma, int semflg) |
5801 | { | 5801 | { |
5802 | struct ipc_security_struct *isec; | 5802 | struct ipc_security_struct *isec; |
5803 | struct common_audit_data ad; | 5803 | struct common_audit_data ad; |
5804 | u32 sid = current_sid(); | 5804 | u32 sid = current_sid(); |
5805 | 5805 | ||
5806 | isec = sma->sem_perm.security; | 5806 | isec = sma->security; |
5807 | 5807 | ||
5808 | ad.type = LSM_AUDIT_DATA_IPC; | 5808 | ad.type = LSM_AUDIT_DATA_IPC; |
5809 | ad.u.ipc_id = sma->sem_perm.key; | 5809 | ad.u.ipc_id = sma->key; |
5810 | 5810 | ||
5811 | return avc_has_perm(sid, isec->sid, SECCLASS_SEM, | 5811 | return avc_has_perm(sid, isec->sid, SECCLASS_SEM, |
5812 | SEM__ASSOCIATE, &ad); | 5812 | SEM__ASSOCIATE, &ad); |
5813 | } | 5813 | } |
5814 | 5814 | ||
5815 | /* Note, at this point, sma is locked down */ | 5815 | /* Note, at this point, sma is locked down */ |
5816 | static int selinux_sem_semctl(struct sem_array *sma, int cmd) | 5816 | static int selinux_sem_semctl(struct kern_ipc_perm *sma, int cmd) |
5817 | { | 5817 | { |
5818 | int err; | 5818 | int err; |
5819 | u32 perms; | 5819 | u32 perms; |
@@ -5851,11 +5851,11 @@ static int selinux_sem_semctl(struct sem_array *sma, int cmd) | |||
5851 | return 0; | 5851 | return 0; |
5852 | } | 5852 | } |
5853 | 5853 | ||
5854 | err = ipc_has_perm(&sma->sem_perm, perms); | 5854 | err = ipc_has_perm(sma, perms); |
5855 | return err; | 5855 | return err; |
5856 | } | 5856 | } |
5857 | 5857 | ||
5858 | static int selinux_sem_semop(struct sem_array *sma, | 5858 | static int selinux_sem_semop(struct kern_ipc_perm *sma, |
5859 | struct sembuf *sops, unsigned nsops, int alter) | 5859 | struct sembuf *sops, unsigned nsops, int alter) |
5860 | { | 5860 | { |
5861 | u32 perms; | 5861 | u32 perms; |
@@ -5865,7 +5865,7 @@ static int selinux_sem_semop(struct sem_array *sma, | |||
5865 | else | 5865 | else |
5866 | perms = SEM__READ; | 5866 | perms = SEM__READ; |
5867 | 5867 | ||
5868 | return ipc_has_perm(&sma->sem_perm, perms); | 5868 | return ipc_has_perm(sma, perms); |
5869 | } | 5869 | } |
5870 | 5870 | ||
5871 | static int selinux_ipc_permission(struct kern_ipc_perm *ipcp, short flag) | 5871 | static int selinux_ipc_permission(struct kern_ipc_perm *ipcp, short flag) |