Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Fetch a null-terminated string. Caller MUST set *(u32 *)dest with max* length and relative data location.

Proto:static inline __attribute__((__always_inline__)) int fetch_store_string(unsigned long addr, void *dest, void *base)

Type:int

Parameter:

TypeParameterName
unsigned longaddr
void *dest
void *base
152  loc = dest
153  maxlen = get_loc_len(loc)
154  dst = get_loc_data(dest, base)
155  __user * src = addr
157  If Value for the false possibility is greater at compile time(!maxlen) Then Return -ENOMEM
160  If addr == FETCH_TOKEN_COMM Then ret = Copy a NUL terminated string into a sized buffer
162  Else ret = Copy a NUL terminated string from userspace
164  If ret >= 0 Then
165  If ret == maxlen Then dst[ret - 1] = '\0'
167  Else ret++
174  dest = data_loc: data location, compatible with u32 (ret, (void * )dst - base)
177  Return ret
Caller
NameDescribe
fetch_store_string_user
process_fetch_insn_bottomFrom the 2nd stage, routine is same