linux/tools/testing/selftests/user_events
Beau Belgrave 97bbce89bf tracing/user_events: Prevent same address and bit per process
User processes register an address and bit pair for events. If the same
address and bit pair are registered multiple times in the same process,
it can cause undefined behavior when events are enabled/disabled.
When more than one are used, the bit could be turned off by another
event being disabled, while the original event is still enabled.

Prevent undefined behavior by checking the current mm to see if any
event has already been registered for the address and bit pair. Return
EADDRINUSE back to the user process if it's already being used.

Update ftrace self-test to ensure this occurs properly.

Link: https://lkml.kernel.org/r/20230425225107.8525-4-beaub@linux.microsoft.com

Suggested-by: Doug Cook <dcook@linux.microsoft.com>
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2023-04-25 21:04:32 -04:00
..
abi_test.c tracing/user_events: Ensure bit is cleared on unregister 2023-04-25 21:04:16 -04:00
dyn_test.c selftests: use canonical ftrace path 2023-03-29 06:52:07 -04:00
ftrace_test.c tracing/user_events: Prevent same address and bit per process 2023-04-25 21:04:32 -04:00
Makefile tracing/user_events: Add ABI self-test 2023-03-29 06:52:09 -04:00
perf_test.c tracing/user_events: Update self-tests to write ABI 2023-03-29 06:52:08 -04:00
settings