lkml.org 
[lkml]   [2024]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] serial: core: Fix atomicity violation in uart_tiocmget
From
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


\
 
 \ /
  Last update: 2024-01-12 12:24    [W:0.077 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site