Re: [PATCH 1/2] userfaultfd: validate the whole range before changing write protection

From: Umang Pokhriyal

Date: Wed Nov 04 2026 - 04:32:28 EST


On Wed, Nov 4, 2026 at 12:24 AM Mike Rapoport <rppt@xxxxxxxxxx> wrote:

> If we a breaking on any error to out_unlock, why do we need err = 0 and
> this check?

We don't, thanks. v2 drops them and the -ENOENT inside the loop. I kept
the one before the loop, because for a range with no VMA both loops are
skipped, and without it the call would return the -EAGAIN left over from
the mmap_changing check instead of -ENOENT.

I'll also drop the selftest.