summaryrefslogtreecommitdiff
path: root/include/linux/debugobjects.h
diff options
context:
space:
mode:
authorPei Xiao <xiaopei01@kylinos.cn>2026-07-01 10:01:10 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-17 16:05:02 +0200
commit7d3a708af7f4e2af9e114d731bd60d30c1ec884e (patch)
treef356cc57354453efa8deed2f06d7fee6db53e228 /include/linux/debugobjects.h
parentb6b5d64cb161a28347d64dc3168a636c4abb68d5 (diff)
ipack: ipoctal: add rwsem to guard against TOCTOU in remove path
The "removed" flag check in each tty op has a TOCTOU race with __ipoctal_remove(): the device could be removed between the flag check and the subsequent access to hardware resources (channel registers via iowrite8, or xmit_buf in write_tty). Close this race by introducing a read-write semaphore (remove_sem). The tty ops acquire the read lock via guard(rwsem_read) for the full duration of the operation, while __ipoctal_remove() acquires the write lock via scoped_guard(rwsem_write) when setting the removed flag. This ensures that once removed is true, no in-flight tty op can still be accessing resources that are about to be freed by the remove path. Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> Link: https://patch.msgid.link/fbce75010a0f0a3a3709a5e06fd0ffd19ca0a0ed.1782870760.git.xiaopei01@kylinos.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions