Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\usercopy.c Create Date:2022-07-28 06:25:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:heck_zeroed_user: check if a userspace buffer only contains zero bytes*@from: Source address, in userspace

Proto:int check_zeroed_user(const void __user *from, size_t size)

Type:int

Parameter:

TypeParameterName
const void __user *from
size_tsize
53  align = from % sizeof(unsignedlong)
55  If Value for the false possibility is greater at compile time(size == 0) Then Return 1
58  from -= align
59  size += align
61  If Not user_access_begin(from, size) Then Return -EFAULT
64  unsafe_get_user(val, (unsignedlong__user * )from, err_fault)
65  If align Then val &= ~aligned_byte_mask(align)
68  When size > sizeof(unsignedlong) cycle
69  If Value for the false possibility is greater at compile time(val) Then Go to done
72  from += sizeof(unsignedlong)
73  size -= sizeof(unsignedlong)
75  unsafe_get_user(val, (unsignedlong__user * )from, err_fault)
78  If size < sizeof(unsignedlong) Then val &= aligned_byte_mask(size)
81  done :
82  user_access_end()
83  Return val == 0
84  err_fault :
85  user_access_end()
86  Return -EFAULT
Caller
NameDescribe
test_check_nonzero_user
copy_struct_from_userpy_struct_from_user: copy a struct from userspace*@dst: Destination address, in kernel space