ring-buffer: Have rb_time_cmpxchg() set the msb counter too
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 15 Dec 2023 13:41:14 +0000 (08:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:02:06 +0000 (17:02 +0100)
commit3432f9686a37a591da81bff73d15da3735e4bac8
tree7aa4ba37c87f9fe203b08e4dfc563371f59ddeea
parentb3778a2fa4a281a21ea0f1d12022cdcf90616f61
ring-buffer: Have rb_time_cmpxchg() set the msb counter too

commit 0aa0e5289cfe984a8a9fdd79ccf46ccf080151f7 upstream.

The rb_time_cmpxchg() on 32-bit architectures requires setting three
32-bit words to represent the 64-bit timestamp, with some salt for
synchronization. Those are: msb, top, and bottom

The issue is, the rb_time_cmpxchg() did not properly salt the msb portion,
and the msb that was written was stale.

Link: https://lore.kernel.org/linux-trace-kernel/20231215084114.20899342@rorschach.local.home
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fixes: f03f2abce4f39 ("ring-buffer: Have 32 bit time stamps use all 64 bits")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/ring_buffer.c