summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/gecko.py
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2025-04-25 23:22:15 -0700
committerMichael S. Tsirkin <mst@redhat.com>2025-05-27 10:27:53 -0400
commit8b3f9967b1fd481ed932f453c38aec99f3c90d95 (patch)
tree7fc8f036ce47d463ef6daa615c969b0543bf36e0 /tools/perf/scripts/python/gecko.py
parent9ef41ebf787fcbde99ac404ae473f8467641f983 (diff)
vhost: vringh: Use matching allocation type in resize_iovec()
In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "struct kvec *", but the returned type will be "struct iovec *". These have the same allocation size, so there is no bug: struct kvec { void *iov_base; /* and that should *never* hold a userland pointer */ size_t iov_len; }; struct iovec { void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ }; Adjust the allocation type to match the assignment. Signed-off-by: Kees Cook <kees@kernel.org> Message-Id: <20250426062214.work.334-kees@kernel.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions