David, do you feel that the proposed fix will at least address the bug
without adverse side-effects?
Usually, when I suspect something is dodgy I unconsciously push back
harder than I usually would.
Please consider using unconsciousness only for self guidance, figuring out
directions, or making decisions on one's own.
For discussions on the list which can get more than one person involved, we
do need consciousness and reasonings.
Thanks for the reproducer, that's definitely good reasonings. Do you have
other reproducer that can trigger an issue without mprotect()?
As I probably mentioned before in other threads mprotect() is IMHO
conceptually against uffd-wp and I don't yet figured out how to use them
all right. For example, we can uffd-wr-protect a pte in uffd-wp range,
then if we do "mprotect(RW)" it's hard to tell whether the user wants it
write or not. E.g., using mprotect(RW) to resolve page faults should be
wrong because it'll not touch the uffd-wp bit at all. I confess I never
thought more on how we should define the interactions between uffd-wp and
mprotect.
In short, it'll be great if you have other reproducers for any uffd-wp
issues other than mprotect().
I said that also because I just got another message from Ives privately
that there _seems_ to have yet another even harder to reproduce bug here
(Ives, feel free to fill in any more information if you got it). So if you
can figure out what's missing and already write a reproducer, that'll be
perfect.