linux-stable/tools
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
..
accounting
arch perf tools fixes for v6.3: 2023-03-10 08:18:46 -08:00
bootconfig tools/bootconfig: fix single & used for logical condition 2023-02-22 08:27:35 +09:00
bpf bpftool: Use bpf_{btf,link,map,prog}_get_info_by_fd() 2023-02-16 15:32:45 -08:00
build tools build: Add test echo-cmd 2023-02-03 13:54:22 -03:00
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio tools: gpio: fix -c option of gpio-event-mon 2023-01-27 14:05:46 +01:00
hv
iio
include Including fixes from netfilter, wifi and ipsec. 2023-03-17 13:31:16 -07:00
io_uring
kvm/kvm_stat tools/kvm_stat: use canonical ftrace path 2023-03-29 06:52:08 -04:00
laptop
leds
lib tracing updates for 6.3: 2023-02-23 10:20:49 -08:00
memory-model
mm tools/mm: allow users to provide additional cflags/ldflags 2023-02-02 22:33:24 -08:00
net/ynl ynl: make the tooling check the license 2023-03-16 21:22:44 -07:00
objtool Changes in this cycle were: 2023-03-02 09:45:34 -08:00
pci
pcmcia
perf perf tools fixes for v6.3: 2023-03-10 08:18:46 -08:00
power Power management fixes for 6.3-rc3 2023-03-17 11:02:26 -07:00
rcu
scripts tools: Add LoongArch build infrastructure 2023-02-25 22:12:18 +08:00
spi
testing tracing/user_events: Prevent same address and bit per process 2023-04-25 21:04:32 -04:00
thermal
time
tracing tracing updates for 6.3: 2023-02-23 10:20:49 -08:00
usb
verification tools/rv: Remove unneeded semicolon 2023-01-31 19:21:12 -05:00
virtio tools/virtio: Ignore virtio-trace/trace-agent 2023-03-13 02:29:12 -04:00
wmi
Makefile