summaryrefslogtreecommitdiffstats
path: root/ipc/msg.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-04-03 22:18:36 +0200
committerLinus Walleij <linus.walleij@linaro.org>2013-04-03 22:18:36 +0200
commit6a7b3e970426f4bc2a8d52f81a4fda6595a9f052 (patch)
tree055765564c839e456fbe4c65c8cd2c4b00d731b7 /ipc/msg.c
parent661462f4c6d3c9ae0bac193c65936ebfac4c95b4 (diff)
parent07961ac7c0ee8b546658717034fe692fd12eefa9 (diff)
downloadop-kernel-dev-6a7b3e970426f4bc2a8d52f81a4fda6595a9f052.zip
op-kernel-dev-6a7b3e970426f4bc2a8d52f81a4fda6595a9f052.tar.gz
Merge tag 'v3.9-rc5' into devel
Linux 3.9-rc5 Conflicts: drivers/pinctrl/pinconf.c
Diffstat (limited to 'ipc/msg.c')
-rw-r--r--ipc/msg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index 950572f..31cd1bf 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, &copy_number);
+ copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax),
+ msgflg, &msgtyp, &copy_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)) {
OpenPOWER on IntegriCloud