lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250121201942.978460684@goodmis.org>
Date: Tue, 21 Jan 2025 15:19:42 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
 Mark Rutland <mark.rutland@....com>,
 Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 Andrew Morton <akpm@...ux-foundation.org>
Subject: [for-next][PATCH 0/2] ring-buffer: atomic: ring-buffer: Fix infinite recursion on some 32bit archs

It was reported[1] that the tracing ring buffer code would cause an infinite
recursion and crash on risc32 and sparc32 architectures. The reason is that
they use the generic atomic64 operations which call raw_spin_locks. As
raw_spin_locks can be traced this would cause an infinite recursion, because
the atomic64 operations call raw_spin_locks. Instead, the generic atomic64
operations should be calling arch_spin_locks as this is architecture
specific implementation and the locks that are taken should never have any
other locks taken while they are held, and are always taking with interrupts
disabled. This means they do not need to be tested by lockdep either.

Another issue was that locks should not be taken in NMI context and the ring
buffer can be called in NMI. If the arch uses the generic atomic64
operations, do not allow events to be recorded in NMI as the atomic64
operations are not safe in NMI context.

[1] https://lore.kernel.org/all/86fb4f86-a0e4-45a2-a2df-3154acc4f086@gaisler.com/

  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
ring-buffer/for-next

Head SHA1: b71b3c12081866affb87c641019473cdee8a8f8c


Steven Rostedt (2):
      ring-buffer: Do not allow events in NMI with generic atomic64 cmpxchg()
      atomic64: Use arch_spin_locks instead of raw_spin_locks

----
 kernel/trace/ring_buffer.c |  9 ++++--
 lib/atomic64.c             | 78 ++++++++++++++++++++++++++++------------------
 2 files changed, 55 insertions(+), 32 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ