Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Get the size of a string in user space

Proto:long strnlen_user(const char __user *str, long count)

Type:long

Parameter:

TypeParameterName
const char __user *str
longcount
96  If Value for the false possibility is greater at compile time(count <= 0) Then Return 0
99  max_addr = user_addr_max()
100  src_addr = Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(str)
101  If Value is more likely to compile time(src_addr < max_addr) Then
102  max = max_addr - src_addr
109  If max > count Then max = count
112  If user_access_begin(str, max) Then
114  user_access_end()
115  Return retval
118  Return 0
Caller
NameDescribe
fetch_store_strlenReturn the length of string -- including null terminal byte
strndup_userstrndup_user - duplicate an existing string from user space*@s: The string to duplicate*@n: Maximum number of bytes to copy, including the trailing NUL.* Return: newly allocated copy of @s or an ERR_PTR() in case of error
create_elf_tables
create_elf_fdpic_tablespresent useful information to the program by shovelling it onto the new* process's stack
create_flat_tablesreate_flat_tables() parses the env- and arg-strings in new user* memory and creates the pointer tables from them, and puts their* addresses on the "stack", recording the new stack pointer value.