]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
tracing/user_events: Limit max fault-in attempts
authorBeau Belgrave <beaub@linux.microsoft.com>
Tue, 25 Apr 2023 22:51:07 +0000 (15:51 -0700)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 26 Apr 2023 01:04:45 +0000 (21:04 -0400)
commit41d8fba193b36ac1208d8f8489390b93675fab7b
tree9ccc495aa71ee5ccf650ab62275e777b6843029e
parent97bbce89bfdec9219dfcb60cd62b815a97cb29cb
tracing/user_events: Limit max fault-in attempts

When event enablement changes, user_events attempts to update a bit in
the user process. If a fault is hit, an attempt to fault-in the page and
the write is retried if the page made it in. While this normally requires
a couple attempts, it is possible a bad user process could attempt to
cause infinite loops.

Ensure fault-in attempts either sync or async are limited to a max of 10
attempts for each update. When the max is hit, return -EFAULT so another
attempt is not made in all cases.

Link: https://lkml.kernel.org/r/20230425225107.8525-5-beaub@linux.microsoft.com
Suggested-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_user.c