Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:getname_flags

Proto:struct filename *getname_flags(const char __user *filename, int flags, int *empty)

Type:struct filename

Parameter:

TypeParameterName
const char __user *filename
intflags
int *empty
134  result = audit_reusename(filename)
135  If result Then Return result
138  result = __getname()
139  If Value for the false possibility is greater at compile time(!result) Then Return ERR_PTR( - ENOMEM)
146  kname = iname
147  pointer to actual string = kname
149  len = Copy a NUL terminated string from userspace
150  If Value for the false possibility is greater at compile time(len < 0) Then
151  __putname(result)
152  Return ERR_PTR(len)
161  If Value for the false possibility is greater at compile time(len == In order to reduce some races, while at the same time doing additional* checking and hopefully speeding things up, we copy filenames to the* kernel data space before using them..* POSIX.1 2.4: an empty pathname is invalid (ENOENT).) Then
162  size = offsetof(structfilename, iname[1])
163  kname = result
170  result = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
172  __putname(kname)
173  Return ERR_PTR( - ENOMEM)
175  pointer to actual string = kname
176  len = Copy a NUL terminated string from userspace
178  __putname(kname)
179  kfree(result)
180  Return ERR_PTR(len)
183  __putname(kname)
184  kfree(result)
185  Return ERR_PTR( - ENAMETOOLONG)
189  refcnt = 1
191  If Value for the false possibility is greater at compile time(!len) Then
192  If empty Then empty = 1
195  putname(result)
196  Return ERR_PTR( - ENOENT)
200  original userland pointer = filename
201  aname = NULL
202  audit_getname(result)
203  Return result
Caller
NameDescribe
COMPAT_SYSCALL_DEFINE5
getname
user_path_at_empty