From: Peter Xu <peterx@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Mike Kravetz <mike.kravetz@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Mike Rapoport <rppt@linux.vnet.ibm.com>,
Axel Rasmussen <axelrasmussen@google.com>,
Nadav Amit <nadav.amit@gmail.com>,
Leonardo Bras Soares Passos <lsoaresp@redhat.com>,
linux-stable <stable@vger.kernel.org>
Subject: Re: [PATCH 01/29] Revert "userfaultfd: don't fail on unrecognized features"
Date: Thu, 30 Mar 2023 18:22:08 -0400 [thread overview]
Message-ID: <ZCYLkA9MM7yhpYBr@x1n> (raw)
In-Reply-To: <6eb02bdd-e69e-d277-c44c-0aefb23430bb@redhat.com>
On Thu, Mar 30, 2023 at 08:31:30PM +0200, David Hildenbrand wrote:
> On 30.03.23 17:56, Peter Xu wrote:
> > This is a proposal to revert commit 914eedcb9ba0ff53c33808.
> >
> > I found this when writting a simple UFFDIO_API test to be the first unit
> > test in this set. Two things breaks with the commit:
> >
> > - UFFDIO_API check was lost and missing. According to man page, the
> > kernel should reject ioctl(UFFDIO_API) if uffdio_api.api != 0xaa. This
> > check is needed if the api version will be extended in the future, or
> > user app won't be able to identify which is a new kernel.
>
> Agreed.
>
> >
> > - Feature flags checks were removed, which means UFFDIO_API with a
> > feature that does not exist will also succeed. According to the man
> > page, we should (and it makes sense) to reject ioctl(UFFDIO_API) if
> > unknown features passed in.
> >
>
> Agreed.
>
> I understand the motivation of the original commit, but it should not have
> changed existing checks/functionality. Introducing a different way to enable
> such functionality on explicit request would be better. But maybe simple
> feature probing (is X support? is Y supported? is Z supported) might be
> easier without requiring ABI changes.
Yes, I mentioned a similar "proposal" of UFFDIO_FEATURES here too, simply
returning the feature bitmask before UFFDIO_API:
https://lore.kernel.org/all/ZCSUTSbAcwBINiNk@x1n/
But I think current way is still fine; so maybe we'd just not bother.
>
> I assume we better add
>
> Fixes: 914eedcb9ba0 ("userfaultfd: don't fail on unrecognized features")
Yes I'll add it.
> Acked-by: David Hildenbrand <david@redhat.com>
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2023-03-30 22:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230330155707.3106228-1-peterx@redhat.com>
2023-03-30 15:56 ` [PATCH 01/29] Revert "userfaultfd: don't fail on unrecognized features" Peter Xu
2023-03-30 18:31 ` David Hildenbrand
2023-03-30 22:22 ` Peter Xu [this message]
2023-03-30 19:04 ` Axel Rasmussen
2023-03-30 22:27 ` Peter Xu
2023-03-31 16:52 ` Axel Rasmussen
2023-03-31 18:08 ` Dmitry Safonov
2023-03-31 20:04 ` Axel Rasmussen
2023-04-03 7:48 ` David Hildenbrand
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=ZCYLkA9MM7yhpYBr@x1n \
--to=peterx@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsoaresp@redhat.com \
--cc=mike.kravetz@oracle.com \
--cc=nadav.amit@gmail.com \
--cc=rppt@linux.vnet.ibm.com \
--cc=stable@vger.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).