Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1188494pxb; Wed, 4 Nov 2020 02:17:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1QYiAJI7ZNMjggrxoWSh2pWA15BqwgkgqlwG4Rqqwe5NsdsMtm4LAvTP3V3ACpgdrytIu X-Received: by 2002:a17:906:34c3:: with SMTP id h3mr24450199ejb.132.1604485050699; Wed, 04 Nov 2020 02:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604485050; cv=none; d=google.com; s=arc-20160816; b=XAkt8tkwP5MIvaq7HosoQwzJuqZglj6AP2d4XiDUDnppVDrRdX64xF/ux/Zg0J0Zlp Gitw7VGbEIKk98O6IEH02DVgt2nqaODYygbybj7fIS45fyhtQtbTL5xDZEC0wjSE/ZXc o6nR13cBHAPMh1KtyCCu/kOAZ4VNTpyiu95WnInJlj3hRDdOnGQh70n41Ii79hj/6TKN X+siGwL5lpl9MdDi3lyplAyhphMnbiabPalm4cmKo+L0GIQ+smZNEsVjmeunhVzlUoDK wokejqexLpqmvShKasox+DwZZKlTdnKypsxtI0Ijumcmsxuuh4OprPEh+k5x8herSWod J5yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZKTHbRCHQ2m9LxF1CZPs6b17a/iPzq1QvSM4mHxSQi4=; b=y2+QmJGbRjdhuUPfKLIcLEQeOQXv7TsAJOIFqKlan1ZD1w3f01X1W3G159ocBZEHE1 wtbp/ymRQXIbomigVac/+6IbHRMy2UGt2fq3yLUAPkOMNuMi/PQBeFUF477BqYRCD4kG CDhWhVBiOojQwrkloSwLQ2Mugy+8/FwtM8Oumz8d5qBmeArO69c5sziGzTKu+hFMGLYr S/InaWgjia0wzpQIy2QTrPJGXt4pZpn8KLXAvrbPFJNuorM8fd6XPMnWcY+ezEM0iWLY FNCwurhfDP9oBJVdKFIHF+8E/I7k14FFTWojlBm7Q5OJJ/iao4EwuQESRkuHNWuh8CcR tL7w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y41si971870ede.192.2020.11.04.02.17.08; Wed, 04 Nov 2020 02:17:30 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729005AbgKDKOd (ORCPT + 99 others); Wed, 4 Nov 2020 05:14:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:38892 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728523AbgKDKOc (ORCPT ); Wed, 4 Nov 2020 05:14:32 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 91879ABDE; Wed, 4 Nov 2020 10:14:31 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 2BF141E1305; Wed, 4 Nov 2020 11:14:31 +0100 (CET) Date: Wed, 4 Nov 2020 11:14:31 +0100 From: Jan Kara To: =?utf-8?B?UGF3ZcWC?= Jasiak Cc: Jan Kara , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Brian Gerst , Andy Lutomirski Subject: Re: PROBLEM: fanotify_mark EFAULT on x86 Message-ID: <20201104101431.GB5600@quack2.suse.cz> References: <20201101212738.GA16924@gmail.com> <20201102122638.GB23988@quack2.suse.cz> <20201103211747.GA3688@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201103211747.GA3688@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 03-11-20 22:17:47, Paweł Jasiak wrote: > I have written small patch that fixes problem for me and doesn't break > x86_64. Yeah, that looks sensible, thanks for the patch. But I'm waiting for some explanation from x86 folks when compat handlers are really needed and why it wasn't needed before syscall wrapper rewrite in 5.7-rc1 and is needed now. Brian, Andy, Thomas? Honza > > diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c > index 3e01d8f2ab90..cf0b97309975 100644 > --- a/fs/notify/fanotify/fanotify_user.c > +++ b/fs/notify/fanotify/fanotify_user.c > @@ -1285,12 +1285,27 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask, > return ret; > } > > +#if defined(CONFIG_X86) && !defined(CONFIG_64BIT) > +SYSCALL_DEFINE6(fanotify_mark, > + int, fanotify_fd, unsigned int, flags, __u32, mask0, > + __u32, mask1, int, dfd, const char __user *, pathname) > +{ > + return do_fanotify_mark(fanotify_fd, flags, > +#ifdef __BIG_ENDIAN > + ((__u64)mask0 << 32) | mask1, > +#else > + ((__u64)mask1 << 32) | mask0, > +#endif > + dfd, pathname); > +} > +#else > SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, > __u64, mask, int, dfd, > const char __user *, pathname) > { > return do_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname); > } > +#endif > > #ifdef CONFIG_COMPAT > COMPAT_SYSCALL_DEFINE6(fanotify_mark, > > > -- > > Paweł Jasiak -- Jan Kara SUSE Labs, CR