From 598b63ccb90b29a49078564d4753bc613d37711d Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 27 Mar 2013 10:24:02 +1100 Subject: [PATCH] revert "ipc: don't allocate a copy larger than max" Revert 88b9e456b164. Dave has confirmed that this was causing oopses during trinity testing. Cc: Peter Hurley Cc: Stanislav Kinsbursky Reported-by: Dave Jones Cc: Signed-off-by: Andrew Morton --- ipc/msg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ipc/msg.c b/ipc/msg.c index fede1d06ef30..4eaf3fd5c9cd 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -820,17 +820,15 @@ 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, min_t(size_t, bufsz, ns->msg_ctlmax), - msgflg, &msgtyp, ©_number); + copy = prepare_copy(buf, bufsz, 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)) { -- 2.39.5