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] [day] [month] [year] [list]
Message-Id: <20250825030217.1663575-1-cuiguoqi@kylinos.cn>
Date: Mon, 25 Aug 2025 11:02:17 +0800
From: cuiguoqi <cuiguoqi@...inos.cn>
To: pmladek@...e.com
Cc: akpm@...ux-foundation.org,
	bigeasy@...utronix.de,
	catalin.marinas@....com,
	clrkwllms@...nel.org,
	cuiguoqi@...inos.cn,
	farbere@...zon.com,
	feng.tang@...ux.alibaba.com,
	guoqi0226@....com,
	joel.granados@...nel.org,
	john.ogness@...utronix.de,
	linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	linux-rt-devel@...ts.linux.dev,
	namcao@...utronix.de,
	rostedt@...dmis.org,
	sravankumarlpu@...il.com,
	takakura@...inux.co.jp,
	tglx@...utronix.de,
	will@...nel.org
Subject: Re: [PATCH] drivers: example: fix memory leak

From: Petr Mladek <pmladek@...e.com>

Hi Petr:
> How did you find this problem, please?
> Were you investigating why a log was missing?
> Or was is just be reading the code?

  When I was developing the Linux real-time kernel, the system abnormally crashed, 
and kdump triggered the inability to normally enter the second kernel for demsg&vmcore saving. 
When an abnormal panic is triggered simultaneously, the abnormal scene and some of the jump logs
of kexec are not output, which to some extent affects the efficiency of debugging and testing

Motivation for the fix:
1. For RT kernels with Kdump deployed, ensure that all relevant information such as call stacks is fully
output to the serial port during the entire process from panic occurrence to transition to the second kernel,
 which can better enhance debugging efficiency.

2. When Kdump is not deployed, the call stack can be directly output in RT kernels as shown below:
```c
vpanic{
+ printk_legacy_allow_panic_sync();

+debug_locks_off();
+console_flush_on_panic(CONSOLE_FLUSH_PENDING);
+console_flush_on_panic(CONSOLE_FLUSH_PENDING);
+nbcon_atomic_flush_unsafe();
}
```

3. Therefore, currently I am wondering whether the issue lies with `debug_locks_off();` or if there is an issue with 
the logical placement of `printk_legacy_allow_panic_sync();`.

My understanding is that by the time we reach machine_kexec(kexec_crash_image);
other cores should have already been notified and shut down. Additionally, 
since this is clearly an emergency situation, flushing the log buffer to the terminal 
should not introduce further adverse effects.
I would greatly appreciate your insights and guidance on this matter.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ