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: <20241021121159.331940-1-ryotkkr98@gmail.com>
Date: Mon, 21 Oct 2024 21:11:59 +0900
From: Ryo Takakura <ryotkkr98@...il.com>
To: john.ogness@...utronix.de
Cc: christophe.leroy@...roup.eu,
	hbathini@...ux.ibm.com,
	leobras.c@...il.com,
	linux-kernel@...r.kernel.org,
	linuxppc-dev@...ts.ozlabs.org,
	maddy@...ux.ibm.com,
	mpe@...erman.id.au,
	naveen@...nel.org,
	npiggin@...il.com,
	pmladek@...e.com,
	ryotkkr98@...il.com,
	sourabhjain@...ux.ibm.com
Subject: Re: [PATCH] powerpc/crash: Allow direct printing on kexec

Hi John!

On 2024-10-20, John Ogness <john.ogness@...utronix.de> wrote:
>On 2024-10-20, Ryo Takakura <ryotkkr98@...il.com> wrote:
>> Let legacy consoles print directly so that we can see messages on kexec, as
>> the commit b6cf8b3f3312 ("printk: add lockless ringbuffer") turned printk
>> ring buffer lockless and there should be no worries panicked CPU 
>> deadlocking writing into ringbuffer after shutting down non-panicked CPU.
>
>It is correct that the ringbuffer is now lockless. But the legacy
>console drivers are not. Allowing them to print directly in panic can
>lead to similar effects that commit af2876b501e4 ("powerpc/crash: Use
>NMI context for printk when starting to crash") was working around.

Oh I see.
I wasn't taking the locks acquired by console drivers into account...
Thanks once again for the feedback!

>Note that although printk is deferred, it is only the printing that is
>deferred. The messages are landing in the ringbuffer immediately. So
>they would be available to kdump and crash kernels.

I also agree to rather skip printing and leave it to kdump and 
crash kernels considering the chance of pointed out risk on panic.

>Rather than removing the deferring, it would be better to convert the
>console you are using to the new NBCON API. Then it would be able to
>print direct and safe during panic. (printk_deferred does not affect
>NBCON consoles.) What console driver are you using that you want to see
>the messages on?

I was working on qemu ppc64 this time but I am usually working on 
Raspberry Pi 4 (mostly for fun and study) which uses either of 
bcm2835-aux-uart or amba-pl011. It would be really nice to see them 
working as nbcon!
I am thinking of taking a look at [0] but If there were any other 
references, I would really like to look into as well.

>John Ogness

Sincerely,
Ryo Takakura

[0] https://lore.kernel.org/lkml/87wn3zsz5x.fsf@jogness.linutronix.de/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ