diff options
| author | Sungho Bae <baver.bae@lge.com> | 2026-06-04 03:37:54 +0900 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2026-09-04 17:06:04 -0400 |
| commit | 526e9d4c88c120466bb0c7e877d90f8f00c9fea4 (patch) | |
| tree | 6c47fb79a86fd475f90a1a539f04f5bbfacbaa1b /scripts/Makefile.thinlto | |
| parent | 612cf35c16f3d7b63a1fb36cdc2e1da9649e3c0d (diff) | |
| download | linux-next-526e9d4c88c120466bb0c7e877d90f8f00c9fea4.tar.gz linux-next-526e9d4c88c120466bb0c7e877d90f8f00c9fea4.zip | |
virtio_console: refactor __send_to_port() buffer ownership
Modify __send_to_port() to take ownership of a struct port_buffer *
instead of a void * raw buffer.
Previously, put_chars() would pass a raw kmemdup'd buffer and free it
immediately after __send_to_port() returned. This caused a potential
Use-After-Free and data corruption if the virtqueue was shared with
nonblocking writers, as virtqueue_get_buf() might return an older
completed buffer, causing the newly added buffer to be kfree'd while the
host is still DMAing from it.
By transferring ownership of the allocated port_buffer to __send_to_port(),
we ensure that the exact buffer returned by the host is the one that gets
freed, resolving the memory lifecycle mismatch.
Signed-off-by: Sungho Bae <baver.bae@lge.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260603183757.21587-2-baver.bae@gmail.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
