linux/tools/testing/vma
Lorenzo Stoakes 4f5b875926 mm/vma: eliminate mmap_action->error_hook, introduce error_override
Rather than providing a hook, simplify things by providing the ability to
override mmap action errors.  This allows us to more carefully validate
the value provided and thus ensure only a valid error code is specified,
and simplifies the interface.

This way, we eliminate all hooks but mmap_prepare and allow only mmap
actions to be specified (which core mm controls).

This significantly improves robustness and eliminates any unnecessary code
duplication in driver mmap hooks.

We also update the /dev/mem logic (the only user) to use
mmap_action->error_override instead.

Link: https://lore.kernel.org/55d13f7d016b827c459946d46a56105635be111c.1780397980.git.ljs@kernel.org
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jann Horn <jannh@google.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-06-04 14:45:00 -07:00
..
include mm/vma: eliminate mmap_action->error_hook, introduce error_override 2026-06-04 14:45:00 -07:00
linux tools: testing: use existing atomic.h for vma/maple tests 2025-09-13 16:55:25 -07:00
tests mm/vma: convert __mmap_region() to use vma_flags_t 2026-04-05 13:53:41 -07:00
.gitignore
main.c mm: abstract reading sysctl_max_map_count, and READ_ONCE() 2026-04-05 13:53:28 -07:00
Makefile tools/testing/vma: add VMA userland tests for VMA flag functions 2026-02-12 15:42:59 -08:00
shared.c tools/testing/vma: convert bulk of test code to vma_flags_t 2026-04-05 13:53:38 -07:00
shared.h tools/testing/vma: convert bulk of test code to vma_flags_t 2026-04-05 13:53:38 -07:00
vma_internal.h mm: introduce vma_flags_count() and vma[_flags]_test_single_mask() 2026-04-05 13:53:40 -07:00