summaryrefslogtreecommitdiffstats
path: root/ipc/msg.c
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2013-04-08 18:10:13 +0200
committerKukjin Kim <kgene.kim@samsung.com>2013-04-08 18:10:13 +0200
commitda821eb7d42935b0f7056d98c75fd1150f6636f4 (patch)
treede83ac171d51bbe7621110c3145a68c198b13711 /ipc/msg.c
parentARM: EXYNOS: fix compilation error introduced due to common clock migration (diff)
parentLinux 3.9-rc5 (diff)
downloadlinux-da821eb7d42935b0f7056d98c75fd1150f6636f4.tar.xz
linux-da821eb7d42935b0f7056d98c75fd1150f6636f4.zip
Merge commit 'v3.9-rc5' into next/clk-exynos
Conflicts: arch/arm/boot/dts/exynos4.dtsi arch/arm/boot/dts/exynos5440.dtsi
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 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, &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)) {