aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/sem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 01:15:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 01:15:42 -0500
commita2e5790d841658485d642196dbb0927303d6c22f (patch)
treeb3d28c9bcb7da6880806146fd22a88a7ee7f733e /ipc/sem.c
parentab2d92ad881da11331280aedf612d82e61cb6d41 (diff)
parent60c3e026d73ccabb075fb70ba02f8512ab40cf2c (diff)
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: - kasan updates - procfs - lib/bitmap updates - other lib/ updates - checkpatch tweaks - rapidio - ubsan - pipe fixes and cleanups - lots of other misc bits * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits) Documentation/sysctl/user.txt: fix typo MAINTAINERS: update ARM/QUALCOMM SUPPORT patterns MAINTAINERS: update various PALM patterns MAINTAINERS: update "ARM/OXNAS platform support" patterns MAINTAINERS: update Cortina/Gemini patterns MAINTAINERS: remove ARM/CLKDEV SUPPORT file pattern MAINTAINERS: remove ANDROID ION pattern mm: docs: add blank lines to silence sphinx "Unexpected indentation" errors mm: docs: fix parameter names mismatch mm: docs: fixup punctuation pipe: read buffer limits atomically pipe: simplify round_pipe_size() pipe: reject F_SETPIPE_SZ with size over UINT_MAX pipe: fix off-by-one error when checking buffer limits pipe: actually allow root to exceed the pipe buffer limits pipe, sysctl: remove pipe_proc_fn() pipe, sysctl: drop 'min' parameter from pipe-max-size converter kasan: rework Kconfig settings crash_dump: is_kdump_kernel can be boolean kernel/mutex: mutex_is_locked can be boolean ...
Diffstat (limited to 'ipc/sem.c')
-rw-r--r--ipc/sem.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ipc/sem.c b/ipc/sem.c
index 87bd38f38dc3..a4af04979fd2 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1213,10 +1213,20 @@ static int semctl_stat(struct ipc_namespace *ns, int semid,
1213 if (err) 1213 if (err)
1214 goto out_unlock; 1214 goto out_unlock;
1215 1215
1216 ipc_lock_object(&sma->sem_perm);
1217
1218 if (!ipc_valid_object(&sma->sem_perm)) {
1219 ipc_unlock_object(&sma->sem_perm);
1220 err = -EIDRM;
1221 goto out_unlock;
1222 }
1223
1216 kernel_to_ipc64_perm(&sma->sem_perm, &semid64->sem_perm); 1224 kernel_to_ipc64_perm(&sma->sem_perm, &semid64->sem_perm);
1217 semid64->sem_otime = get_semotime(sma); 1225 semid64->sem_otime = get_semotime(sma);
1218 semid64->sem_ctime = sma->sem_ctime; 1226 semid64->sem_ctime = sma->sem_ctime;
1219 semid64->sem_nsems = sma->sem_nsems; 1227 semid64->sem_nsems = sma->sem_nsems;
1228
1229 ipc_unlock_object(&sma->sem_perm);
1220 rcu_read_unlock(); 1230 rcu_read_unlock();
1221 return id; 1231 return id;
1222 1232