diff options
| author | Sungho Bae <baver.bae@lge.com> | 2026-06-04 03:37:55 +0900 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-31 14:20:02 +0200 |
| commit | a616ad344d9f7fe6abc17aa0a43bba93fb077384 (patch) | |
| tree | 4e8f362506a1046a91e20d0b29d70152cfff1b14 /tools/perf/scripts/python/bin | |
| parent | fc220d6be3c7e484b83f92bf6327e17c1ab1d962 (diff) | |
virtio_console: fix hot-unplug races in TX paths
When a port is hot-unplugged, unplug_port() nullifies port->portdev.
However, concurrent TX paths (__send_to_port, put_chars) could read a
stale pointer or encounter a NULL pointer dereference.
Add READ_ONCE(port->portdev) and NULL checks in the TX paths. In
__send_to_port(), move the out_vq assignment inside the outvq_lock and
check portdev under the lock. Correspondingly, update unplug_port() to
NULL out port->portdev while holding the outvq_lock to serialize with
__send_to_port().
In put_chars(), return count instead of 0 on unplug to prevent the hvc
layer from spinning in an infinite retry loop.
Signed-off-by: Sungho Bae <baver.bae@lge.com>
Link: https://patch.msgid.link/20260603183757.21587-3-baver.bae@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
