linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Brian Gerst <brgerst@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>, Jan Kara <jack@suse.cz>,
	linux-arch <linux-arch@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>, Al Viro <viro@zeniv.linux.org.uk>,
	Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	X86 ML <x86@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH] fanotify: Fix fanotify_mark() on 32-bit x86
Date: Tue, 1 Dec 2020 09:30:07 +0100	[thread overview]
Message-ID: <20201201083007.GA24488@quack2.suse.cz> (raw)
In-Reply-To: <CAMzpN2gkNnqnT3hS4jaHTphO+KdZmC=9Hi4tXk3RV9C-EcwtLQ@mail.gmail.com>

On Mon 30-11-20 17:21:08, Brian Gerst wrote:
> On Fri, Nov 27, 2020 at 7:36 PM Andy Lutomirski <luto@kernel.org> wrote:
> >
> > On Fri, Nov 27, 2020 at 2:30 PM Brian Gerst <brgerst@gmail.com> wrote:
> > >
> > > On Fri, Nov 27, 2020 at 1:13 PM Andy Lutomirski <luto@kernel.org> wrote:
> > > >
> > > > On Thu, Nov 26, 2020 at 7:52 AM Jan Kara <jack@suse.cz> wrote:
> > > > >
> > > > > 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 x86 builds. Add missed conversion. It is somewhat
> > > > > cumbersome since we need to keep the original compat handler for all the
> > > > > other 32-bit archs.
> > > > >
> > > >
> > > > This is stupendously ugly.  I'm not really sure how this is supposed
> > > > to work on any 32-bit arch.  I'm also not sure whether we should
> > > > expect the SYSCALL_DEFINE macros to figure this out by themselves.
> > >
> > > It works on 32-bit arches because the compiler implicitly uses
> > > consecutive input registers or stack slots for 64-bit arguments, and
> > > some arches have alignment requirements that result in hidden padding.
> > > x86-32 is different now because parameters are passed in via pt_regs,
> > > and the 64-bit value has to explicitly be reassembled from the high
> > > and low 32-bit values, just like in the compat case.
> > >
> >
> > That was my guess.
> >
> > > I think the simplest way to handle this is add a wrapper in
> > > arch/x86/kernel/sys_ia32.c with the other fs syscalls that need 64-bit
> > > args.  That keeps this mess out of general code.
> >
> >
> > Want to send a patch?
> 
> I settled on doing something along the same line as Jan, but in a more
> generic way that lays the groundwork for converting more of these
> arch-specific compat wrappers to a generic wrapper.

Cool, thanks for looking into this!

> Patch coming soon.

Looking forward to it :)

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-12-01  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26 15:52 [PATCH] fanotify: Fix fanotify_mark() on 32-bit x86 Jan Kara
2020-11-27 18:13 ` Andy Lutomirski
2020-11-27 22:30   ` Brian Gerst
2020-11-28  0:36     ` Andy Lutomirski
2020-11-30 22:21       ` Brian Gerst
2020-12-01  8:30         ` Jan Kara [this message]
2020-12-02 10:14 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201201083007.GA24488@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=hch@lst.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).