Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:strncpy_from_unsafe_user: - Copy a NUL terminated string from unsafe user* address.*@dst: Destination address, in kernel space. This buffer must be at* least @count bytes long.*@unsafe_addr: Unsafe user address.

Proto:long strncpy_from_unsafe_user(char *dst, const void __user *unsafe_addr, long count)

Type:long

Parameter:

TypeParameterName
char *dst
const void __user *unsafe_addr
longcount
228  old_fs = get_fs()
231  If Value for the false possibility is greater at compile time(count <= 0) Then Return 0
234  set_fs(USER_DS)
235  These routines enable/disable the pagefault handler. If disabled, it will* not take any locks and go straight to the fixup table.* User access methods will not sleep when called from a pagefault_disabled()* environment.
236  ret = Copy a NUL terminated string from userspace
237  pagefault_enable()
238  set_fs(old_fs)
240  If ret >= count Then
241  ret = count
242  dst[ret - 1] = '\0'
243  Else if ret > 0 Then
244  ret++
247  Return ret
Caller
NameDescribe
fetch_store_string_userFetch a null-terminated string from user. Caller MUST set *(u32 *)buf* with max length and relative data location.