diff options
| author | Sungho Bae <baver.bae@lge.com> | 2026-06-04 03:37:55 +0900 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2026-09-04 17:06:04 -0400 |
| commit | e17b6c1e54e9324386d92cd868d15814f1d683f1 (patch) | |
| tree | d89c10b82b6a93e3192e71577f155fe85e5928f9 /scripts/Makefile.thinlto | |
| parent | 526e9d4c88c120466bb0c7e877d90f8f00c9fea4 (diff) | |
| download | linux-next-e17b6c1e54e9324386d92cd868d15814f1d683f1.tar.gz linux-next-e17b6c1e54e9324386d92cd868d15814f1d683f1.zip | |
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>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260603183757.21587-3-baver.bae@gmail.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
