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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84y0qtdk99.fsf@jogness.linutronix.de>
Date: Fri, 05 Sep 2025 16:58:34 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Marcos Paulo de Souza <mpdesouza@...e.com>, Greg Kroah-Hartman
 <gregkh@...uxfoundation.org>, Petr Mladek <pmladek@...e.com>, Steven
 Rostedt <rostedt@...dmis.org>, Sergey Senozhatsky
 <senozhatsky@...omium.org>, Jason Wessel <jason.wessel@...driver.com>,
 Daniel Thompson <danielt@...nel.org>, Douglas Anderson
 <dianders@...omium.org>
Cc: linux-kernel@...r.kernel.org, kgdb-bugreport@...ts.sourceforge.net,
 Marcos Paulo de Souza <mpdesouza@...e.com>
Subject: Re: [PATCH v3 3/4] printk: nbcon: Allow KDB to acquire the NBCON
 context

On 2025-09-02, Marcos Paulo de Souza <mpdesouza@...e.com> wrote:
> diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
> index ff218e95a505fd10521c2c4dfb00ad5ec5773953..352235a0eb4a484caccf86d3a57d1a149218ecec 100644
> --- a/kernel/printk/nbcon.c
> +++ b/kernel/printk/nbcon.c
> @@ -255,6 +258,7 @@ static int nbcon_context_try_acquire_direct(struct nbcon_context *ctxt,
>  		 * interrupted by the panic CPU while printing.
>  		 */
>  		if (other_cpu_in_panic() &&
> +		    READ_ONCE(kdb_printf_cpu) != raw_smp_processor_id() &&

This needs some sort of ifdef CONFIG_KGDB_KDB wrapped around it. Maybe
it would be cleaner to have some macro.

#ifdef CONFIG_KGDB_KDB
#define KGDB_IS_ACTIVE() (READ_ONCE(kdb_printf_cpu) == raw_smp_processor_id())
#else
#define KGDB_IS_ACTIVE() false
#endif

and then something like:

	if (other_cpu_in_panic() &&
	    !KGDB_IS_ACTIVE() &&
	    (!is_reacquire || cur->unsafe_takeover)) {
		return -EPERM;
	}

Or however you prefer. We need to compile for !CONFIG_KGDB_KDB.

John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ