Re: [RFC, PATCH 10/12] userfaultfd: add UFFDIO_SET_MODE for runtime sync/async toggle

Kiryl Shutsemau
2026-04-16T13:27:27Z

On Wed, Apr 15, 2026 at 08:08:59AM -0700, Usama Arif wrote:
> > + /* only toggleable features are allowed */
> > + if ((mode.enable | mode.disable) & ~UFFD_FEATURE_TOGGLEABLE)
> > + return -EINVAL;
>
> The commit message states "Only async features that were enabled at
> UFFDIO_API time may be toggled." However, the code only checks that
> the requested feature is in UFFD_FEATURE_TOGGLEABLE.
>
> Is it intentional that a user who opened a uffd without
> UFFD_FEATURE_MINOR_ASYNC can still enable it later via
> UFFDIO_SET_MODE?

The comment is stale. Will fix.

--
Kiryl Shutsemau / Kirill A. Shutemov