Skip to content

Commit b6600ef

Browse files
committed
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>
1 parent c53ad75 commit b6600ef

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tools/virtio/linux/ucopysize.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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__ */

0 commit comments

Comments
 (0)