函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\uaccess.h Create Date:2022-07-27 06:58:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:copy_to_user

函数原型:static __always_inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)

返回类型:unsigned long

参数:

类型参数名称
void __user *to
const void *from
unsigned longn
151  如果此条件成立可能性大(为编译器优化)(check_copy_size(from, n, true))则n等于_copy_to_user(to, from, n)
153  返回:n
调用者
名称描述
seq_buf_to_userseq_buf_to_user - copy the squence buffer to user space*@s: seq_buf descriptor*@ubuf: The userspace memory location to copy to*@cnt: The amount to copy* Copies the sequence buffer into the userspace memory pointed to* by @ubuf
kfifo_copy_to_user
copy_user_test
test_check_nonzero_user
test_copy_struct_from_user
test_user_copy_init
read_ldt
do_get_thread_area
mtrr_ioctl
msr_read
msr_ioctl
cpuid_read
do_read
copy_oldmem_pagepy_oldmem_page - copy one page from "oldmem"*@pfn: page frame number to be copied*@buf: target memory address for the copy; this can be in kernel address* space or user address space (see @userbuf)*@csize: number of bytes to copy*@offset: offset in bytes
emulate_push_stack
arch_uretprobe_hijack_return_addr
fixup_umip_exceptionxup_umip_exception() - Fixup a general protection fault caused by UMIP*@regs: Registers as saved when entering the #GP handler* The instructions SGDT, SIDT, STR, SMSW and SLDT cause a general protection* fault if executed with CPL > 0 (i
SYSCALL_DEFINE5
SYSCALL_DEFINE4
COMPAT_SYSCALL_DEFINE5
_proc_do_string/proc/sys support
proc_put_longproc_put_long - converts an integer to a decimal ASCII formatted string*@buf: the user buffer*@size: the size of the user buffer*@val: the integer to be converted*@neg: sign of the number, %TRUE for negative* In case of success %0 is returned and @buf and
ptrace_readdata
ptrace_request
SYSCALL_DEFINE4sys_rt_sigprocmask - change the list of currently blocked signals*@how: whether to add, remove, or set signals*@nset: stores pending signals*@oset: previous value of signal mask if non-null*@sigsetsize: size of sigset_t type
SYSCALL_DEFINE2sys_rt_sigpending - examine a pending signal that has been raised* while blocked*@uset: stores pending signals*@sigsetsize: size of sigset_t type or larger
copy_siginfo_to_user32
copy_siginfo_to_user32
SYSCALL_DEFINE2
do_compat_sigaltstack
SYSCALL_DEFINE1sys_sigpending - examine pending signals*@uset: where mask of pending signal is returned
SYSCALL_DEFINE3sys_sigprocmask - examine and change blocked signals*@how: whether to add, remove, or set signals*@nset: signals to add or remove (if non-null)*@oset: previous value of signal mask if non-null* Some platforms have their own version with special arguments;
SYSCALL_DEFINE4sys_rt_sigaction - alter an action taken by a process*@sig: signal to be sent*@act: new sigaction*@oact: used to save the previous sigaction*@sigsetsize: size of sigset_t type
SYSCALL_DEFINE1
COMPAT_SYSCALL_DEFINE1
override_releaseWork around broken programs that cannot handle "Linux 3.0".* Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40* And we map 4.x and later versions to 2.6.60+x, so 4.0/5.0/6.0/... would be* 2.6.60.
SYSCALL_DEFINE1
SYSCALL_DEFINE1Old cruft
SYSCALL_DEFINE1
SYSCALL_DEFINE2
SYSCALL_DEFINE2
COMPAT_SYSCALL_DEFINE2
SYSCALL_DEFINE2Back compatibility for getrlimit. Needed for some apps.
SYSCALL_DEFINE4
SYSCALL_DEFINE2
SYSCALL_DEFINE5
SYSCALL_DEFINE1
SYSCALL_DEFINE2sys_sched_getparam - get the RT priority of a thread*@pid: the pid in question.*@param: structure containing the RT priority.* Return: On success, 0 and the RT priority is in @param. Otherwise, an error* code.
sched_attr_copy_to_userCopy the kernel size attribute structure (which might be larger* than what user-space knows about) to user-space.* Note that all cases are valid: user-space buffer can be larger or* smaller than the kernel-space buffer. The usual case is that both
SYSCALL_DEFINE3sys_sched_getaffinity - get the CPU affinity of a process*@pid: pid of the process*@len: length in bytes of the bitmask pointed to by user_mask_ptr*@user_mask_ptr: user-space pointer to hold the current CPU mask
devkmsg_read
syslog_print
syslog_print_all
read_profileThis function accesses profiling information. The returned data is* binary: the sampling step and the actual contents of the profile* buffer. Use of the program readprofile is recommended in order to* get meaningful info out of these data.
SYSCALL_DEFINE2
COMPAT_SYSCALL_DEFINE2
put_timespec64
__put_old_timespec32
put_old_timespec32
do_timer_createCreate a POSIX.1b interval timer.
SYSCALL_DEFINE2
put_itimerval
put_old_itimerval32
COMPAT_SYSCALL_DEFINE4
compat_put_timeval
compat_put_timespec
put_compat_rusage
seccomp_get_notif_sizes
relay_file_read
tracing_buffers_read
perf_event_query_prog_array
bpf_prog_array_copy_to_user
map_lookup_elem
map_get_next_key
map_lookup_and_delete_elem
bpf_prog_get_info_by_fd
bpf_map_get_info_by_fd
bpf_task_fd_query_copy
bpf_verifier_vlog
btf_get_info_by_fd
bpf_prog_offload_info_fill
__cgroup_bpf_queryMust be called with cgroup_mutex held to avoid races.
__cgroup_bpf_run_filter_getsockopt
perf_read_group
perf_read_one
_perf_ioctl
SYSCALL_DEFINE3The mincore(2) system call
copy_nodes_to_userCopy a kernel node mask to user space
COMPAT_SYSCALL_DEFINE3
COMPAT_SYSCALL_DEFINE6
COMPAT_SYSCALL_DEFINE4
do_pages_statDetermine the nodes of a user array of pages and store it in* a user array of status.
gup_benchmark_ioctl
print_page_owner
store_msg
copy_msqid_to_user
ksys_msgctl
copy_compat_msqid_to_user
compat_ksys_msgctl
copy_semid_to_user
semctl_info
semctl_main
copy_compat_semid_to_user
copy_shmid_to_user
copy_shminfo_to_user
ksys_shmctl
copy_compat_shminfo_to_user
put_compat_shm_info
copy_compat_shmid_to_user
SYSCALL_DEFINE3
put_compat_mq_attr
blkdev_getgeo
blk_complete_sghdr_rq
sg_scsi_ioctlsg_scsi_ioctl -- handle deprecated SCSI_IOCTL_SEND_COMMAND ioctl*@q: request queue to send scsi commands down*@disk: gendisk to operate on (option)*@mode: mode used to open the file through which the ioctl has been* submitted*@sic: userspace structure
put_sg_io_hdr
scsi_cmd_ioctl
bsg_scsi_complete_rq
bsg_sg_io
bsg_transport_complete_rq
compat_hdio_getgeo
blkdev_copy_zone_to_user
blkdev_report_zones_ioctlBLKREPORTZONE ioctl processing.* Called from blkdev_ioctl.
read_table_data
keyctl_describe_keyReturn a description of a key to userspace
keyctl_get_securityGet a key's the LSM security label.* The key must grant the caller View permission for this to work.* If there's a buffer, then up to buflen bytes of data will be placed into it.* If successful, the amount of information available will be returned,
keyctl_capabilitiesGet keyrings subsystem capabilities.
request_key_auth_readRead the callout_info data (retrieves the callout information).* - the key's semaphore is read-locked
user_readad the key data* - the key's semaphore is read-locked
keyctl_dh_compute_kdf
__keyctl_dh_compute
keyctl_pkey_queryQuery information about an asymmetric key.
keyctl_pkey_e_d_sEncrypt/decrypt/sign* Encrypt data, decrypt data or sign data using a public key
big_key_readad the key data* - the key's semaphore is read-locked
trusted_readrusted_read - copy the sealed blob data to userspace in hex.* On success, return to userspace the trusted key datablob size.
encrypted_readrypted_read - format and copy the encrypted data to userspace* The resulting datablob format is:* * On success, return to userspace the encrypted key datablob size.
selinux_socket_getpeersec_stream
smack_socket_getpeersec_streamsmack_socket_getpeersec_stream - pull in packet label*@sock: the socket*@optval: user's destination*@optlen: size thereof*@len: max thereof* returns zero on success, an error code otherwise
tomoyo_flushmoyo_flush - Flush queued string to userspace's buffer.*@head: Pointer to "struct tomoyo_io_buffer".* Returns true if all data was flushed, false otherwise.
tomoyo_read_selfmoyo_read_self - read() for /sys/kernel/security/tomoyo/self_domain interface.*@file: Pointer to "struct file".*@buf: Domainname which current thread belongs to.*@count: Size of @buf.*@ppos: Bytes read by now.
apparmor_socket_getpeersec_streamapparmor_socket_getpeersec_stream - get security context of peer* Note: for tcp only valid if using ipsec or cipso on lan
SYSCALL_DEFINE5
SYSCALL_DEFINE6
cp_old_statFor backward compatibility? Maybe this should be moved* into arch/i386 instead?
cp_new_stat
cp_new_stat64
cp_statx
cp_compat_stat
do_pipe2sys_pipe() is the normal C calling standard for creating* a pipe. It's not the way Unix traditionally does this, though.
readlink_copy
f_getown_ex
fcntl_rw_hint
do_fcntl
SYSCALL_DEFINE3
put_compat_flock
put_compat_flock64
fiemap_fill_next_extent
ioctl_fiemap
ioctl_file_dedupe_range
do_vfs_ioctlWhen you add any new common ioctls to the switches above and below* please update compat_sys_ioctl() too.* do_vfs_ioctl() is not for drivers and not intended to be EXPORT_SYMBOL()'d.* It's just a simple helper for sys_ioctl and compat_sys_ioctl.
compat_filldir
poll_select_finish
seq_readseq_read - ->read() method for sequential files.*@file: the file to read from*@buf: the buffer to read to*@size: the maximum number of bytes to read*@ppos: the current position in the file* Ready-made ->f_op->read()
getxattrExtended attribute GET operations
listxattrExtended attribute LIST operations
simple_read_from_buffersimple_read_from_buffer - copy data from the buffer to user space*@to: the user space buffer to read to*@count: the maximum number of bytes to read*@ppos: the current position in the buffer*@from: the buffer to read from*@available: the size of the
do_spliceDetermine where to splice to/from.
SYSCALL_DEFINE2NOTE! The user-level library version returns a* character pointer
do_statfs_native
do_statfs64
SYSCALL_DEFINE2
put_compat_statfs
put_compat_statfs64
COMPAT_SYSCALL_DEFINE2This is a copy of sys_ustat, just dealing with a structure layout.* Given how simple this syscall is that apporach is more maintainable* than the various conversion hacks.
fscontext_readAllow the user to read back any error, warning or informational messages.
copy_event_to_userCopy an event to user space, returning how much we copied.* We already checked that the event size is smaller than the* buffer we had in "get_one_event()" above.
copy_fid_to_user
copy_event_to_user
signalfd_copyinfoCopied from copy_siginfo_to_user() in kernel/signal.c
userfaultfd_read
userfaultfd_apiserland asks for a certain API version and we return which bits* and ioctl commands are implemented in this kernel for such API* version or -EINVAL if unknown.
aio_read_events_ringaio_read_events_ring* Pull an event off of the ioctx's event ring. Returns the number of* events fetched
io_uring_setupSets up an aio uring context, and returns the fd. Applications asks for a* ring size, we return the actual sq/cq ring sizes (among other things) in the* params structure passed in.
fscrypt_ioctl_add_keyAdd a master encryption key to the filesystem, causing all files which were* encrypted with it to appear "unlocked" (decrypted) when accessed.* When adding a key for use by v1 encryption policies, this ioctl is
fscrypt_ioctl_get_key_statusRetrieve the status of an fscrypt master encryption key
fscrypt_ioctl_get_policyOriginal ioctl version; can only get the original policy version
fscrypt_ioctl_get_policy_exExtended ioctl version; can get policies of any version
fsverity_ioctl_measuresverity_ioctl_measure() - get a verity file's measurement* Retrieve the file measurement that the kernel is enforcing for reads from a* verity file
create_elf_tables
create_elf_fdpic_tablespresent useful information to the program by shovelling it onto the new* process's stack
do_sys_name_to_handle
quota_getfmt
quota_getinfo
quota_getquota
quota_getnextquotaReturn quota for next active quota >= this id, if any exists,* otherwise return -ENOENT via ->get_nextdqblk
quota_getxstate
quota_getxstatev
quota_getxquota
quota_getnextxquotaReturn quota for next active quota >= this id, if any exists,* otherwise return -ENOENT via ->get_nextdqblk.
do_lookup_dcookieAnd here is where the userspace process can look up the cookie value* to retrieve the path.
put_compat_sigsetDefined inline such that size can be compile time constant, which avoids* CONFIG_HARDENED_USERCOPY complaining about copies from task_struct
ib_copy_to_udata
copy_siginfo_to_user