]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
ring-buffer: Do not let subbuf be bigger than write mask
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 20 Feb 2024 14:51:12 +0000 (09:51 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 21 Feb 2024 14:15:23 +0000 (09:15 -0500)
commite78fb4eac817308027da88d02e5d0213462a7562
treeeb69e770b741d51fdc193a2f2c50503df8c08b7d
parentb401b621758e46812da61fa58a67c3fd8d91de0d
ring-buffer: Do not let subbuf be bigger than write mask

The data on the subbuffer is measured by a write variable that also
contains status flags. The counter is just 20 bits in length. If the
subbuffer is bigger than then counter, it will fail.

Make sure that the subbuffer can not be set to greater than the counter
that keeps track of the data on the subbuffer.

Link: https://lore.kernel.org/linux-trace-kernel/20240220095112.77e9cb81@gandalf.local.home
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fixes: 2808e31ec12e5 ("ring-buffer: Add interface for configuring trace sub buffer size")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ring_buffer.c