Re: [PATCH] serial: core: Fix atomicity violation in uart_tiocmget
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH] serial: core: Fix atomicity violation in uart_tiocmget
- From: Gui-Dong Han <2045gemini@xxxxxxxxx>
- Date: Fri, 12 Jan 2024 19:23:17 +0800
- Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Jiri Slaby <jirislaby@xxxxxxxxxx>, Tony Lindgren <tony@xxxxxxxxxxx>, l.sanfilippo@xxxxxxxxxx, tglx@xxxxxxxxxxxxx, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, linux-serial <linux-serial@xxxxxxxxxxxxxxx>, baijiaju1990@xxxxxxxxxxx, stable@xxxxxxxxxxxxxxx
- In-reply-to: <4a52df23-71c3-59c7-fee4-e7cde526d249@linux.intel.com>
- User-agent: Mozilla Thunderbird
Hi,
You are correct about the 'Fixes' tag. It should indeed be c5f4644e6c8b
("[PATCH] Serial: Adjust serial locking"). I will update this in the
patch v2.
Regarding the issue found in Linux 5.17, I mistakenly used git blame
which led to the incorrect identification of commit 559c7ff4e324. The
issue indeed exists in Linux 5.17 and I acknowledge the error in tracing
the commit.
In uart_tiocmget(), the result variable is stable. However, there's a
risk of inconsistency due to the updates in uart_update_mctrl().
Consider a scenario where uart_tiocmget() reads uport->mctrl into result
before entering the critical section. If uart_update_mctrl() updates
port->mctrl and calls set_mctrl concurrently, the subsequent execution
of result |= uport->ops->get_mctrl(uport); in uart_tiocmget() might
yield an inaccurate result. This happens because result contains the old
value of port->mctrl, which no longer matches the updated state
retrieved by get_mctrl.
Thanks,
Han
[Index of Archives]
[Linux Kernel]
[Kernel Development Newbies]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Yosemite Hiking]
[Linux Kernel]
[Linux SCSI]