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]
Date: Wed, 17 Jan 2024 13:08:14 +0000
From: "Chang, Junxiao" <junxiao.chang@...el.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>, John Ogness
	<john.ogness@...utronix.de>
CC: "tglx@...utronix.de" <tglx@...utronix.de>, "rostedt@...dmis.org"
	<rostedt@...dmis.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "Li, Hao3" <hao3.li@...el.com>, "Li, Lili"
	<lili.li@...el.com>, "Gao, Jianfeng" <jianfeng.gao@...el.com>,
	"linux-rt-users@...r.kernel.org" <linux-rt-users@...r.kernel.org>
Subject: RE: RE: [PATCH] printk: nbcon: check uart port is nbcon or not in
 nbcon_release

Hi John,

As you mentioned, same console driver is only registered once. 8250 console driver is registered once, its "struct console *newcon" parameter is address of "univ8250_console" which is defined in drivers\tty\serial\8250\8250_core.c.

However, in each serial port device is registered, their cons pointer( "struct console *cons;" in "struct uart_port") will be assigned with same cons in API serial_core_add_one_port:
	uport->cons = drv->cons;
That is, multiple similar 8250 uart_port devices have same console pointer which points to above univ8250_console.

Hi Sebastain,

The ADL hardware I used has two UART devices, one is lpss 8250, another is 8250_dw. Usually there is no serial port in consumer product. Maybe there is serial port in Intel ADL industrial product.
With my hardware, hang issue could be reproduced every time with 6.6.7-rt18 if serial console is enabled. If you or John need me to run some test build and get debug log with my hardware, please feel free to let me know.


The main problem is that there is "nbcon" checking in nbcon_acquire, but no this checking in nbcon_release. It makes nbcon lock not balance. My patch is just to add same "uart_is_nbcon" checking in nb_release.

void nbcon_acquire(struct uart_port *up)
{
	...
	if (!uart_is_nbcon(up))
		return;
	...

Thanks,
Junxiao

-----Original Message-----
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de> 
Sent: Wednesday, January 17, 2024 6:25 PM
To: John Ogness <john.ogness@...utronix.de>
Cc: Chang, Junxiao <junxiao.chang@...el.com>; tglx@...utronix.de; rostedt@...dmis.org; linux-kernel@...r.kernel.org; Li, Hao3 <hao3.li@...el.com>; Li, Lili <lili.li@...el.com>; Gao, Jianfeng <jianfeng.gao@...el.com>; linux-rt-users@...r.kernel.org
Subject: Re: RE: [PATCH] printk: nbcon: check uart port is nbcon or not in nbcon_release

On 2024-01-17 11:09:24 [+0106], John Ogness wrote:
> On 2024-01-17, "Chang, Junxiao" <junxiao.chang@...el.com> wrote:
> > There are several serial ports in one Intel ADL hardware, they are 
> > enumerated as ttyS0, ttyS1, ttyS4, and so on. Multiple console 
> > options might be appended to kernel command line. For example,
> > "console=ttyS0,115200n8 console=ttyS4,115200n8 
> > console=ttyS5,115200n8".
> >
> > In this case, several uarts "cons" pointers are same.
> 
> So I ask again. Please explain how this is possible.

I have here
| 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
| 00:04: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A

and I have

| root        2315  0.0  0.0   5480  1792 ttyS0    Ss+  11:19   0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,57600,38400,9600 - vt220
| root        2502  0.1  0.0   5480  1792 ttyS1    Ss+  11:20   0:00 /sbin/agetty -o -p -- \u --keep-baud 115200,57600,38400,9600 - vt220

and I can stop both of them without any trouble. 
Can this be reproduced on an ordinary x86 hardware given they have more than one UART (up to four).
Is any of this ADL hardware upstream?

> John

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ