From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753335AbbBWWWh (ORCPT ); Mon, 23 Feb 2015 17:22:37 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:38420 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751861AbbBWWWe (ORCPT ); Mon, 23 Feb 2015 17:22:34 -0500 Date: Mon, 23 Feb 2015 17:22:32 -0500 (EST) Message-Id: <20150223.172232.1309715810003183775.davem@davemloft.net> To: catalin.marinas@arm.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, will.deacon@arm.com, luto@amacapital.net Subject: Re: [PATCH RESEND] net: compat: Ignore MSG_CMSG_COMPAT in compat_sys_{send,recv}msg From: David Miller In-Reply-To: <1424715176-22369-1-git-send-email-catalin.marinas@arm.com> References: <1424715176-22369-1-git-send-email-catalin.marinas@arm.com> X-Mailer: Mew version 6.5 on Emacs 24.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.7 (shards.monkeyblade.net [149.20.54.216]); Mon, 23 Feb 2015 14:22:34 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Catalin Marinas Date: Mon, 23 Feb 2015 18:12:56 +0000 > With commit a7526eb5d06b (net: Unbreak compat_sys_{send,recv}msg), the > MSG_CMSG_COMPAT flag is blocked at the compat syscall entry points, > changing the kernel compat behaviour from the one before the commit it > was trying to fix (1be374a0518a, net: Block MSG_CMSG_COMPAT in > send(m)msg and recv(m)msg). > > On 32-bit kernels (!CONFIG_COMPAT), MSG_CMSG_COMPAT is 0 and the native > 32-bit sys_sendmsg() allows flag 0x80000000 to be set (it is ignored by > the kernel). However, on a 64-bit kernel, the compat ABI is different > with commit a7526eb5d06b. > > This patch changes the compat_sys_{send,recv}msg behaviour to the one > prior to commit 1be374a0518a. > > The problem was found running 32-bit LTP (sendmsg01) binary on an arm64 > kernel. Arguably, LTP should not pass 0xffffffff as flags to sendmsg() > but the general rule is not to break user ABI (even when the user > behaviour is not entirely sane). > > Fixes: a7526eb5d06b (net: Unbreak compat_sys_{send,recv}msg) > Signed-off-by: Catalin Marinas Applied and queued up for -stable, thanks.