diff options
Diffstat (limited to 'ipc/sem.c')
-rw-r--r-- | ipc/sem.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -817,7 +817,7 @@ static int semctl_nolock(struct ipc_namespace *ns, int semid, | |||
817 | } | 817 | } |
818 | 818 | ||
819 | err = -EACCES; | 819 | err = -EACCES; |
820 | if (ipcperms (&sma->sem_perm, S_IRUGO)) | 820 | if (ipcperms(ns, &sma->sem_perm, S_IRUGO)) |
821 | goto out_unlock; | 821 | goto out_unlock; |
822 | 822 | ||
823 | err = security_sem_semctl(sma, cmd); | 823 | err = security_sem_semctl(sma, cmd); |
@@ -862,7 +862,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, | |||
862 | nsems = sma->sem_nsems; | 862 | nsems = sma->sem_nsems; |
863 | 863 | ||
864 | err = -EACCES; | 864 | err = -EACCES; |
865 | if (ipcperms (&sma->sem_perm, (cmd==SETVAL||cmd==SETALL)?S_IWUGO:S_IRUGO)) | 865 | if (ipcperms(ns, &sma->sem_perm, |
866 | (cmd == SETVAL || cmd == SETALL) ? S_IWUGO : S_IRUGO)) | ||
866 | goto out_unlock; | 867 | goto out_unlock; |
867 | 868 | ||
868 | err = security_sem_semctl(sma, cmd); | 869 | err = security_sem_semctl(sma, cmd); |
@@ -1047,7 +1048,8 @@ static int semctl_down(struct ipc_namespace *ns, int semid, | |||
1047 | return -EFAULT; | 1048 | return -EFAULT; |
1048 | } | 1049 | } |
1049 | 1050 | ||
1050 | ipcp = ipcctl_pre_down(&sem_ids(ns), semid, cmd, &semid64.sem_perm, 0); | 1051 | ipcp = ipcctl_pre_down(ns, &sem_ids(ns), semid, cmd, |
1052 | &semid64.sem_perm, 0); | ||
1051 | if (IS_ERR(ipcp)) | 1053 | if (IS_ERR(ipcp)) |
1052 | return PTR_ERR(ipcp); | 1054 | return PTR_ERR(ipcp); |
1053 | 1055 | ||
@@ -1386,7 +1388,7 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, | |||
1386 | goto out_unlock_free; | 1388 | goto out_unlock_free; |
1387 | 1389 | ||
1388 | error = -EACCES; | 1390 | error = -EACCES; |
1389 | if (ipcperms(&sma->sem_perm, alter ? S_IWUGO : S_IRUGO)) | 1391 | if (ipcperms(ns, &sma->sem_perm, alter ? S_IWUGO : S_IRUGO)) |
1390 | goto out_unlock_free; | 1392 | goto out_unlock_free; |
1391 | 1393 | ||
1392 | error = security_sem_semop(sma, sops, nsops, alter); | 1394 | error = security_sem_semop(sma, sops, nsops, alter); |