Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1212815pxu; Mon, 23 Nov 2020 14:51:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcxFOgyl/VjtVsY7izHS73SIhcf7+2Ra6+5wT2xy/P5ns+0AAnSLtbobyXFai61sdDSZH5 X-Received: by 2002:a17:906:4ec8:: with SMTP id i8mr1765900ejv.184.1606171867418; Mon, 23 Nov 2020 14:51:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606171867; cv=none; d=google.com; s=arc-20160816; b=eNzF25vlqEUL0Ih5pCEf0dsYGO4vYoLAUCg9GAzG0+xYINMZ4s5ZfSE4PHx8Huc1ou LJ2CSUghHHMxYNiMZe7ebls+bCWbIMJoq81L5HFG+9BPulJ3iPl9/qdnQOiSdrQAE26P gIsJ2dq7RUIJ+M2fHJTnJNkzxbRAJUVMdRiAyrkcpz9N+JplnVjlO3Nk9/rOy3iG7lm7 wIhYU2rbaoJl/UGg374+msI7EJ2LLGXrTSL4kl+HKzMVcAfCNf3JRlkW7K+fqJF4/QNR aZvDNrYZ23OnXQuxPi96L+l/P9y95ctaWzykTGqT+qvps8vFi4ANynT0jWUB9oNOdfA8 Q99A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2kFEjBabQcANouc2ZtbSNLTwqyFoPLbdSDW7PtNlwTQ=; b=lrOy5vATDpYzfXEJdnroQlfpANIzykatON5CDeEr//O6cuBPY6OHYGv9mGv3Ihlglb w5v3JxdsQCv9jvxbBFC0rIZakvYe7jQUotM9N2F7liOAhbjhcHzwueCFLASCfNf5y0kT kzkyW8ACEBuk9i8QjTtNE6yxrw3fGlMGnnRhRMKzHDsMOJoCEj4KFzNCeVT3LJIVRmMb ELUoyRti8Sso9Iy17NJuRbp1tSpVdrtsZURs0Hp0hSF/yQ+jeAOkflEWGzlzP8D4UmJG ceSRI/DMOMSzFP/ZAfZmfEBlsh9djV7a5UAFNkREy5+6lKKQCGwwdlboc4rFoHZw6P1B dP6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jasiak-xyz.20150623.gappssmtp.com header.s=20150623 header.b=qzWD0WCy; 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 h2si7455505ejp.136.2020.11.23.14.50.44; Mon, 23 Nov 2020 14:51:07 -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=@jasiak-xyz.20150623.gappssmtp.com header.s=20150623 header.b=qzWD0WCy; 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 S2387450AbgKWWrE (ORCPT + 99 others); Mon, 23 Nov 2020 17:47:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731007AbgKWWrC (ORCPT ); Mon, 23 Nov 2020 17:47:02 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A20ACC061A4D for ; Mon, 23 Nov 2020 14:46:55 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id t22so7454818ljk.0 for ; Mon, 23 Nov 2020 14:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jasiak-xyz.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=2kFEjBabQcANouc2ZtbSNLTwqyFoPLbdSDW7PtNlwTQ=; b=qzWD0WCyEO/aZMoVIpmH8IJW7lS97cszkL/eiEVPOao15KtWDx3DaJkvIeYFf94U3q 0nEcY4V2ZomYm4kcvBS/QKgCfcU6/3acoyRWKvHlRiNIARIPoK69avlVHHA18FUaG12S MC90WC+T2VMmAIRk6VhVNOtg6/3YR2ei9RGtUZG7bGRur4GMasLkMZcBSztAtXFGswyR pso00tVooCYKLXh+RQc1WqF8jgRHU/7PrYlsfbLJpRdP0F09fVLMywQxhOI/ngONKa0/ CVMWa9nSSE5Qia1OZpUwbdaOax3maWzSVUfFZTqoGek28VT7a0QD+0jOiJrYGXlw5HN6 NwcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=2kFEjBabQcANouc2ZtbSNLTwqyFoPLbdSDW7PtNlwTQ=; b=hkbzx1Iju0AgabQlGvc8K0y3VB3SD3kD3PEbIDt5/iFmrmTg3ZW8dI/cqOQEm9f7UJ lz95aADJgDlbbACDJUB/KO6ZoWJeOIRZrxuITNijuwo5xWeY3IlE8C9KVh+B6XXPZOcV BxNwNLwTJs/SjmUF/zrZtXS0Q27tFGlmo6e40WkEjR71Kyh6JAVBRihYi9PmPhPQNat9 P0Jr0AyEhfW/OP3adQZUHzHowY6kf1CbJuQOFQPsst6ZMCTe9hnhQ4J85QDi2W29cgN+ XkfpvR8bTJ0ryNCLyCv+BFiTPjfMZ6dgAnZSG1qv1PiT6Xec0YPV/5XpT/u275o4dHwg thZw== X-Gm-Message-State: AOAM531+kKFu/YcLjBytrINilCXLx3qAqyCbCDBFzz5MlIk5FrY1kKhc V49j+wcv8nuCmgwyUhtdRIdk7TUEG5pYQsj1 X-Received: by 2002:a2e:580d:: with SMTP id m13mr698751ljb.200.1606171614069; Mon, 23 Nov 2020 14:46:54 -0800 (PST) Received: from gmail.com (wireless-nat-78.ip4.greenlan.pl. [185.56.211.78]) by smtp.gmail.com with ESMTPSA id q129sm110852ljb.81.2020.11.23.14.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 14:46:53 -0800 (PST) Date: Mon, 23 Nov 2020 23:46:51 +0100 From: =?utf-8?B?UGF3ZcWC?= Jasiak To: Jan Kara Cc: 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: <20201123224651.GA27809@gmail.com> References: <20201101212738.GA16924@gmail.com> <20201102122638.GB23988@quack2.suse.cz> <20201103211747.GA3688@gmail.com> <20201123164622.GJ27294@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201123164622.GJ27294@quack2.suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/11/20, Jan Kara wrote: > OK, with a help of Boris Petkov I think I have a fix that looks correct > (attach). Can you please try whether it works for you? Thanks! Unfortunately I am getting a linker error. ld: arch/x86/entry/syscall_32.o:(.rodata+0x54c): undefined reference to `__ia32_sys_ia32_fanotify_mark' > -- > Jan Kara > SUSE Labs, CR > From fc9104a50a774ec198c1e3a145372cde77df7967 Mon Sep 17 00:00:00 2001 > From: Jan Kara > Date: Mon, 23 Nov 2020 17:37:00 +0100 > Subject: [PATCH] fanotify: Fix fanotify_mark() on 32-bit archs > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > Commit converting syscalls taking 64-bit arguments to new scheme of compat > handlers omitted converting fanotify_mark(2) which then broke the > syscall for 32-bit ABI. Add missed conversion. > > CC: Brian Gerst > Suggested-by: Borislav Petkov > Reported-by: Paweł Jasiak > Reported-by: Naresh Kamboju > Fixes: 121b32a58a3a ("x86/entry/32: Use IA32-specific wrappers for syscalls taking 64-bit arguments") > CC: stable@vger.kernel.org > Signed-off-by: Jan Kara > --- > arch/x86/entry/syscalls/syscall_32.tbl | 2 +- > fs/notify/fanotify/fanotify_user.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl > index 0d0667a9fbd7..b2ec6ff88307 100644 > --- a/arch/x86/entry/syscalls/syscall_32.tbl > +++ b/arch/x86/entry/syscalls/syscall_32.tbl > @@ -350,7 +350,7 @@ > 336 i386 perf_event_open sys_perf_event_open > 337 i386 recvmmsg sys_recvmmsg_time32 compat_sys_recvmmsg_time32 > 338 i386 fanotify_init sys_fanotify_init > -339 i386 fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark > +339 i386 fanotify_mark sys_ia32_fanotify_mark > 340 i386 prlimit64 sys_prlimit64 > 341 i386 name_to_handle_at sys_name_to_handle_at > 342 i386 open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at > diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c > index 3e01d8f2ab90..e20e7b53a87f 100644 > --- a/fs/notify/fanotify/fanotify_user.c > +++ b/fs/notify/fanotify/fanotify_user.c > @@ -1293,7 +1293,7 @@ SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, > } > > #ifdef CONFIG_COMPAT > -COMPAT_SYSCALL_DEFINE6(fanotify_mark, > +SYSCALL_DEFINE6(ia32_fanotify_mark, > int, fanotify_fd, unsigned int, flags, > __u32, mask0, __u32, mask1, int, dfd, > const char __user *, pathname) > -- > 2.16.4 > -- Paweł Jasiak