Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\thread_info.h Create Date:2022-07-28 05:35:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:check_copy_size

Proto:static __always_inline __must_check bool check_copy_size(const void *addr, size_t bytes, bool is_source)

Type:bool

Parameter:

TypeParameterName
const void *addr
size_tbytes
boolis_source
140  sz = __compiletime_object_size(addr)
141  If Value for the false possibility is greater at compile time(sz >= 0 && sz < bytes) Then
142  If Not __builtin_constant_p(bytes) Then copy_overflow(sz, bytes)
144  Else if is_source Then __bad_copy_from()
146  Else __bad_copy_to()
148  Return false
150  If WARN_ON_ONCE(bytes > INT_MAX) Then Return false
152  check_object_size(addr, bytes, is_source)
153  Return true