diff options
author | Liam R. Howlett <Liam.Howlett@oracle.com> | 2023-09-21 14:12:35 -0400 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-09-29 17:20:46 -0700 |
commit | 5c590804b6b0ff933ed4e5cee5d76de3a5048d9f (patch) | |
tree | eaba1036909d61a02ee8660c003f2271b154d75c /lib/test_fortify/write_overflow-strlcpy.c | |
parent | 7ee29facd8a9c5a26079148e36bcf07141b3a6bc (diff) |
maple_tree: add mas_is_active() to detect in-tree walks
Patch series "maple_tree: Fix mas_prev() state regression".
Pedro Falcato retported an mprotect regression [1] which was bisected back
to the iterator changes for maple tree. Root cause analysis showed the
mas_prev() running off the end of the VMA space (previous from 0) followed
by mas_find(), would skip the first value.
This patchset introduces maple state underflow/overflow so the sequence of
calls on the maple state will return what the user expects.
Users who encounter this bug may see mprotect(), userfaultfd_register(),
and mlock() fail on VMAs mapped with address 0.
This patch (of 2):
Instead of constantly checking each possibility of the maple state,
create a fast path that will skip over checking unlikely states.
Link: https://lkml.kernel.org/r/20230921181236.509072-1-Liam.Howlett@oracle.com
Link: https://lkml.kernel.org/r/20230921181236.509072-2-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy.c')
0 files changed, 0 insertions, 0 deletions