mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 16:41:58 +00:00
820b8963ad
The trace event sock_exceed_buf_limit saves the prot->sysctl_mem pointer
and then dereferences it in the TP_printk() portion. This is unsafe as the
TP_printk() portion is executed at the time the buffer is read. That is,
it can be seconds, minutes, days, months, even years later. If the proto
is freed, then this dereference will can also lead to a kernel crash.
Instead, save the sysctl_mem array into the ring buffer and have the
TP_printk() reference that instead. This is the proper and safe way to
read pointers in trace events.
Link: https://lore.kernel.org/all/20220706052130.16368-12-kuniyu@amazon.com/
Cc: stable@vger.kernel.org
Fixes:
|
||
---|---|---|
.. | ||
events | ||
stages | ||
bpf_probe.h | ||
define_custom_trace.h | ||
define_trace.h | ||
perf.h | ||
syscall.h | ||
trace_custom_events.h | ||
trace_events.h |