diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2013-05-28 10:09:22 +0200 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2013-05-28 10:09:29 +0200 |
| commit | 864bfb25b57a6766ea689befa5cf09a4353281ce (patch) | |
| tree | 478941ca6e76b8d77b71f5827a3ce751c46a72b5 /ipc/msg.c | |
| parent | 071361d3473ebb8142907470ff12d59c59f6be72 (diff) | |
| parent | 49717cb40410fe4b563968680ff7c513967504c6 (diff) | |
| download | cachepc-linux-864bfb25b57a6766ea689befa5cf09a4353281ce.tar.gz cachepc-linux-864bfb25b57a6766ea689befa5cf09a4353281ce.zip | |
Merge branch 'master' into for-next
Merge with 49717cb ("kthread: Document ways of reducing OS jitter due
to per-CPU kthreads") to be able to apply fixup patch on top of it.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'ipc/msg.c')
| -rw-r--r-- | ipc/msg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ipc/msg.c b/ipc/msg.c index 950572f9d796..31cd1bf6af27 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -820,15 +820,17 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, struct msg_msg *copy = NULL; unsigned long copy_number = 0; + ns = current->nsproxy->ipc_ns; + if (msqid < 0 || (long) bufsz < 0) return -EINVAL; if (msgflg & MSG_COPY) { - copy = prepare_copy(buf, bufsz, msgflg, &msgtyp, ©_number); + copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax), + msgflg, &msgtyp, ©_number); if (IS_ERR(copy)) return PTR_ERR(copy); } mode = convert_mode(&msgtyp, msgflg); - ns = current->nsproxy->ipc_ns; msq = msg_lock_check(ns, msqid); if (IS_ERR(msq)) { |
