diff options
| author | Ingo Molnar <mingo@kernel.org> | 2013-03-21 11:03:10 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2013-03-21 11:03:10 +0100 |
| commit | 3bf2391729822e591dcfbbd1e9dd2f450968cdcb (patch) | |
| tree | 80a0499e57a4cc95b6caea559400b5226ebe606f /ipc/msg.c | |
| parent | 86e213e1d901fbeaf6e57d13c5edd925fadddcbe (diff) | |
| parent | fd4a5aef002bb57e8a35ed34d8a878034b9bde94 (diff) | |
Merge branch 'perf/urgent' into perf/core
Merge in all pending fixes, before pulling the latest development
bits from Arnaldo - which will involve merge conflicts.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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)) { |
