[PATCH 0/1] userfaultfd: check VM_MAYWRITE was set after verifying the uffd is registered

From: Andrea Arcangeli
Date: Thu Dec 06 2018 - 16:20:39 EST


Hello,

The juxtaposition with the other bugchecks didn't make it apparent
that the this WARN_ON was one line too soon.

An app trying to unregister a not-yet-registered range will trigger an
_harmless_ false positive WARN_ON. No real app would do that so it
went unnoticed during testing.

This should be applied on top of 29ec90660d68 ("userfaultfd:
shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas") to shut off
the false positive warning.

Thanks,
Andrea

Andrea Arcangeli (1):
userfaultfd: check VM_MAYWRITE was set after verifying the uffd is
registered

fs/userfaultfd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)