diff options
| author | Sungho Bae <baver.bae@lge.com> | 2026-06-04 03:37:54 +0900 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-31 14:20:02 +0200 |
| commit | fc220d6be3c7e484b83f92bf6327e17c1ab1d962 (patch) | |
| tree | 7b82c9d65885e7fa34037ed6e144b6ab7248dfad /tools/perf/scripts/python/bin | |
| parent | c16ce856e422e73a54c41131e0332de1afe09b8b (diff) | |
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>
Link: https://patch.msgid.link/20260603183757.21587-2-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
