diff options
author | Nadav Amit <[email protected]> | 2021-10-18 15:15:25 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2021-10-18 20:22:02 -1000 |
commit | cb185d5f1ebf900f4ae3bf84cee212e6dd035aca (patch) | |
tree | 1156aa57eb9c1c0c0c52a72ddb33fa91e827584f /tools/perf/scripts/python/arm-cs-trace-disasm.py | |
parent | 8913970c19915bbe773d97d42989cd85b7fdc098 (diff) |
userfaultfd: fix a race between writeprotect and exit_mmap()
A race is possible when a process exits, its VMAs are removed by
exit_mmap() and at the same time userfaultfd_writeprotect() is called.
The race was detected by KASAN on a development kernel, but it appears
to be possible on vanilla kernels as well.
Use mmget_not_zero() to prevent the race as done in other userfaultfd
operations.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 63b2d4174c4ad ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl")
Signed-off-by: Nadav Amit <[email protected]>
Tested-by: Li Wang <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/arm-cs-trace-disasm.py')
0 files changed, 0 insertions, 0 deletions