From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754269AbbDQNax (ORCPT ); Fri, 17 Apr 2015 09:30:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33412 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932648AbbDQNat (ORCPT ); Fri, 17 Apr 2015 09:30:49 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mateusz Guzik , Gabriellla Schmidt , Al Viro , Davidlohr Bueso , Manfred Spraul , Andrew Morton , Linus Torvalds , Masanari Iida Subject: [PATCH 3.10 28/34] ipc: fix compat msgrcv with negative msgtyp Date: Fri, 17 Apr 2015 15:29:00 +0200 Message-Id: <20150417132555.505040835@linuxfoundation.org> X-Mailer: git-send-email 2.3.5 In-Reply-To: <20150417132553.751904098@linuxfoundation.org> References: <20150417132553.751904098@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mateusz Guzik commit e7ca2552369c1dfe0216c626baf82c3d83ec36bb upstream. Compat function takes msgtyp argument as u32 and passes it down to do_msgrcv which results in casting to long, thus the sign is lost and we get a big positive number instead. Cast the argument to signed type before passing it down. Signed-off-by: Mateusz Guzik Reported-by: Gabriellla Schmidt Cc: Al Viro Cc: Davidlohr Bueso Cc: Manfred Spraul Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: Masanari Iida Signed-off-by: Greg Kroah-Hartman --- ipc/compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/ipc/compat.c +++ b/ipc/compat.c @@ -381,7 +381,7 @@ COMPAT_SYSCALL_DEFINE6(ipc, u32, call, i uptr = compat_ptr(ipck.msgp); fifth = ipck.msgtyp; } - return do_msgrcv(first, uptr, second, fifth, third, + return do_msgrcv(first, uptr, second, (s32)fifth, third, compat_do_msg_fill); } case MSGGET: