diff options
author | Laurent Vivier <lvivier@redhat.com> | 2023-08-24 18:44:52 +0200 |
---|---|---|
committer | Laurent Vivier <lvivier@redhat.com> | 2024-03-12 11:54:26 +0100 |
commit | 1bf4abe4021192a4bcd5d400b699552f2a6d5777 (patch) | |
tree | 6b7c39bd1213fe6e9fe5e06139f25837b2ed7302 /packet.c | |
parent | 37f457a76c8f412a0a2ceb79c77b91eea24ef341 (diff) | |
download | passt-1bf4abe4021192a4bcd5d400b699552f2a6d5777.tar passt-1bf4abe4021192a4bcd5d400b699552f2a6d5777.tar.gz passt-1bf4abe4021192a4bcd5d400b699552f2a6d5777.tar.bz2 passt-1bf4abe4021192a4bcd5d400b699552f2a6d5777.tar.lz passt-1bf4abe4021192a4bcd5d400b699552f2a6d5777.tar.xz passt-1bf4abe4021192a4bcd5d400b699552f2a6d5777.tar.zst passt-1bf4abe4021192a4bcd5d400b699552f2a6d5777.zip |
vhost-user: use guest buffer directly in vu_handle_tx()
Check the buffer address is correctly in the mmap'ed memory.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -25,6 +25,12 @@ static int packet_check_range(const struct pool *p, size_t offset, size_t len, const char *start, const char *func, int line) { + ASSERT(p->buf); + + if (p->buf_size == 0) + return vu_packet_check_range((void *)p->buf, offset, len, start, + func, line); + if (start < p->buf) { if (func) { trace("add packet start %p before buffer start %p, " |