Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp223125pxu; Tue, 1 Dec 2020 09:39:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0QEVYWyGEAUCYQGXrf+7t7V6wNIeImz20O/wanJhWR4ZDvPZx5uOxq6xdef5K2wuwoxkY X-Received: by 2002:a17:906:d41:: with SMTP id r1mr4017521ejh.383.1606844345850; Tue, 01 Dec 2020 09:39:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606844345; cv=none; d=google.com; s=arc-20160816; b=WNNkITkvmxz6HB75UMasaJd65zQ8KqjEQ6YhEy5TZgi8UVYmWVPNhljVTk1UG9817Y hDlwfx/NLasksRDbs7AS3T6vtM95kbtuwpkAZ2N4n/ZcJQWj0HsuokUGb1kvgaq1wfgw vWy7va+K7kveX0JiRFWlJXS8UFF3uQhLvlBrpbDOwiI/dCk2wZFrK/jANCrA6ZvR3TNj bgPOQm0G/jeYMOW9a3kBVuzTVBzXEXdAXsX6xPdU1O+4YlAbAa32YAcAOvYnvzhEw++i h31RlCEXPJYoy9gmcdJJCRQNrd/mHPnt8eqY8NcvRsEvWlqU7QbC3o5BzW3kvngsAj8j //tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=NIHoV1wdiG9vMfzuPVr56YC+mOmswR4A2vc2vMRzol8=; b=dE1g7UMQnaeUlqt1DvpV2AbVejGOvuiFT+kqIEIqFDPhx5BEBEzpC3+XeXqarZT59h 3Mm4RcScAKCHlv8Le7l4rWhJzovfnj0v0UEoFwqn+fDkwKROSu6boYWPAD4WMjJKdCmk V/JPm3AP9Oy3FBJerSNh5MDikt5R2tg1s5KLFTnVx+Thpgx9DsHm7ndtiHQJyVDCtGyG UM3nzQbCt227ZxaCCXtblql1rcmZbDHcQFr/u9ggw8TIElr/efJ5JG9+Q4YJSe5Inidk 2SCk8kRMnMOt5XLPu2FuyZ56KCRDekX/xpuh1ZtxJR+zdshiMBRc1rrQKSQhKJt8W4rc MKrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n1i1E8GJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si316764edr.365.2020.12.01.09.38.40; Tue, 01 Dec 2020 09:39:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n1i1E8GJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391075AbgLARf2 (ORCPT + 99 others); Tue, 1 Dec 2020 12:35:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:50280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387675AbgLARf2 (ORCPT ); Tue, 1 Dec 2020 12:35:28 -0500 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B2FD2222A for ; Tue, 1 Dec 2020 17:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606844087; bh=HPHXfa9WzujbQ8iqtPTqDoLuYdFQl9v40MfbtTjD2js=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=n1i1E8GJo0iTC189ZlegWaBlJ6H1QCid3nRy3CFE4fQTeCUghXsuaTCrxyHKQAnv+ BNUT9wbtAIY8TTVRxm0W902uc5RbXbaa08ODt4/z6IZxg3n3JrKN4KPSHq6HqQ4iu+ rHvPmteA1xsB24l2icXxub8y+VpkvM/uVfReFNcw= Received: by mail-wr1-f52.google.com with SMTP id e7so3910463wrv.6 for ; Tue, 01 Dec 2020 09:34:47 -0800 (PST) X-Gm-Message-State: AOAM531BNehE2icragT7ZtnGYDkB6y/Yd0RLUgA2jnAj3pV+hPsafFam irqF6MD+eUJ1nHs28rL6vFBayiqBJJpAYSbGCzNHPA== X-Received: by 2002:adf:f0c2:: with SMTP id x2mr5214512wro.184.1606844085619; Tue, 01 Dec 2020 09:34:45 -0800 (PST) MIME-Version: 1.0 References: <20201130223059.101286-1-brgerst@gmail.com> In-Reply-To: From: Andy Lutomirski Date: Tue, 1 Dec 2020 09:34:32 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] fanotify: Fix sys_fanotify_mark() on native x86-32 To: Andy Lutomirski , linux-arch Cc: Brian Gerst , LKML , X86 ML , Borislav Petkov , Thomas Gleixner , Jan Kara , =?UTF-8?Q?Pawe=C5=82_Jasiak?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2020 at 9:23 AM Andy Lutomirski wrote: > > On Mon, Nov 30, 2020 at 2:31 PM Brian Gerst wrote: > > > > Commit 121b32a58a3a converted native x86-32 which take 64-bit arguments= to > > use the compat handlers to allow conversion to passing args via pt_regs= . > > sys_fanotify_mark() was however missed, as it has a general compat hand= ler. > > Add a config option that will use the syscall wrapper that takes the sp= lit > > args for native 32-bit. > > > > Reported-by: Pawe=C5=82 Jasiak > > Fixes: 121b32a58a3a ("x86/entry/32: Use IA32-specific wrappers for sysc= alls taking 64-bit arguments") > > Signed-off-by: Brian Gerst > > --- > > arch/Kconfig | 6 ++++++ > > arch/x86/Kconfig | 1 + > > fs/notify/fanotify/fanotify_user.c | 17 +++++++---------- > > include/linux/syscalls.h | 24 ++++++++++++++++++++++++ > > 4 files changed, 38 insertions(+), 10 deletions(-) > > > > diff --git a/arch/Kconfig b/arch/Kconfig > > index 090ef3566c56..452cc127c285 100644 > > --- a/arch/Kconfig > > +++ b/arch/Kconfig > > @@ -1045,6 +1045,12 @@ config HAVE_STATIC_CALL_INLINE > > bool > > depends on HAVE_STATIC_CALL > > > > +config ARCH_SPLIT_ARG64 > > + bool > > + help > > + If a 32-bit architecture requires 64-bit arguments to be spl= it into > > + pairs of 32-bit arguemtns, select this option. > > You misspelled arguments. You might also want to clarify that, for > 64-bit arches, this means that compat syscalls split their arguments. No, that's backwards. Maybe it should be depends !64BIT instead. But I'm really quite confused about something: what's special about x86 here? Are there really Linux arches (compat or 32-bit native) that *don't* split arguments like this? Sure, some arches probably work the same way that x86 used to in which the compiler did the splitting by magic for us, but that was always a bit of a kludge. Could this change maybe be made unconditional? --Andy > > Aside from that: > > Acked-by: Andy Lutomirski