aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-memcpy.c
diff options
context:
space:
mode:
authorPaolo Bonzini <[email protected]>2022-04-08 13:09:04 -0700
committerLinus Torvalds <[email protected]>2022-04-08 14:20:36 -1000
commit01e67e04c28170c47700c2c226d732bbfedb1ad0 (patch)
treec6bb531bdfd0459b88e2777ca429dfe0cb666df5 /lib/test_fortify/write_overflow-memcpy.c
parenta431dbbc540532b7465eae4fc8b56a85a9fc7d17 (diff)
mmmremap.c: avoid pointless invalidate_range_start/end on mremap(old_size=0)
If an mremap() syscall with old_size=0 ends up in move_page_tables(), it will call invalidate_range_start()/invalidate_range_end() unnecessarily, i.e. with an empty range. This causes a WARN in KVM's mmu_notifier. In the past, empty ranges have been diagnosed to be off-by-one bugs, hence the WARNing. Given the low (so far) number of unique reports, the benefits of detecting more buggy callers seem to outweigh the cost of having to fix cases such as this one, where userspace is doing something silly. In this particular case, an early return from move_page_tables() is enough to fix the issue. Link: https://lkml.kernel.org/r/[email protected] Reported-by: [email protected] Signed-off-by: Paolo Bonzini <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-memcpy.c')
0 files changed, 0 insertions, 0 deletions