Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/virtio: add ucopysize.h stub

Add ucopysize.h with stub implementations of check_object_size,
copy_overflow, and check_copy_size.

Created using Cursor CLI.

Message-ID: <5046df90002bb744609248404b81d33b559fe813.1764873799.git.mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

+21
+21
tools/virtio/linux/ucopysize.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __LINUX_UCOPYSIZE_H__ 3 + #define __LINUX_UCOPYSIZE_H__ 4 + 5 + #include <linux/bug.h> 6 + 7 + static inline void check_object_size(const void *ptr, unsigned long n, 8 + bool to_user) 9 + { } 10 + 11 + static inline void copy_overflow(int size, unsigned long count) 12 + { 13 + } 14 + 15 + static __always_inline __must_check bool 16 + check_copy_size(const void *addr, size_t bytes, bool is_source) 17 + { 18 + return true; 19 + } 20 + 21 + #endif /* __LINUX_UCOPYSIZE_H__ */