Documented in 1 files:

Defined in 17 files as a prototype:

Defined in 4 files as a function:

Referenced in 30 files:

Smatch caller information:

fs/xattr.c import_xattr_name() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 2 count 256
BUF_SIZE 0 dst 256
DATA_SOURCE 1 src $1
USER_DATA 1 src 0-u64max
UNITS 2 count unit_byte
HALF_LOCKED2 &ctx->uring_lock

drivers/gpu/drm/virtio/virtgpu_ioctl.c virtio_gpu_context_init_ioctl() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 2 count 64
BUF_SIZE 0 dst 65
LOCK2 &vfpriv->context_lock
TYPE_LOCK (struct virtio_gpu_fpriv)->context_lock

net/mptcp/sockopt.c strncpy_from_sockptr() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 3263507651120549888
PARAM_VALUE 2 count 1-15
BUF_SIZE 0 dst 16
BUF_SIZE 0 dst 16
CAPPED_DATA 2 count 1
DATA_SOURCE 0 dst $0
DATA_SOURCE 2 count $2

fs/namei.c do_getname() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 2 count 168
BUF_SIZE 0 dst 168
BUF_SIZE 0 dst 168
DATA_SOURCE 1 src $0
USER_DATA 1 src 0-u64max
UNITS 2 count unit_byte
HALF_LOCKED2 &ctx->uring_lock

fs/namei.c getname_long() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 1 src 4096-ptr_max
PARAM_VALUE 2 count 3928
BUF_SIZE 0 dst 3928
UNITS 0 dst unit_byte
UNITS 1 src unit_byte
UNITS 2 count unit_byte
HALF_LOCKED2 &ctx->uring_lock

kernel/trace/trace_syscalls.c syscall_copy_user() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 2 count 0-169
BUF_SIZE 0 dst (-1),510,4096
BUF_SIZE 0 dst (-1),510,4096
CAPPED_DATA 2 count 1
DATA_SOURCE 0 dst $0 [m]
DATA_SOURCE 2 count $2
USER_DATA 2 count 1-169[c]

kernel/bpf/syscall.c bpf_raw_tp_link_attach() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 3944565161994092544
PARAM_VALUE 2 count 127
BUF_SIZE 0 dst 128
DATA_SOURCE 1 src $1
UNITS 2 count unit_byte

kernel/bpf/syscall.c strncpy_from_bpfptr() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 6972248444984299520
PARAM_VALUE 2 count 127
BUF_SIZE 0 dst 128
BUF_SIZE 0 dst 128
DATA_SOURCE 0 dst $0
DATA_SOURCE 2 count $2
UNITS 2 count unit_byte

mm/maccess.c strncpy_from_user_nofault() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 2 count 1-s64max
BUF_SIZE 0 dst (-1)-0,8,256,512,1024
BUF_SIZE 0 dst (-1)-0,8,256,512,1024
DATA_SOURCE 0 dst $0
DATA_SOURCE 1 src $1
DATA_SOURCE 2 count $2
STR_LEN 0 dst (-1),10
STR_LEN 0 dst (-1),10
STR_LEN 1 src (-1),10
PREEMPT_ADD
RX_PATH
TASK_NOT_RUNNING
UNITS 0 dst unit_byte
UNITS 1 src unit_byte
UNITS 2 count unit_byte

net/ipv4/tcp.c strncpy_from_sockptr() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 6934393096618680320
PARAM_VALUE 2 count 1-15
BUF_SIZE 0 dst 16
BUF_SIZE 0 dst 16
CAPPED_DATA 2 count 1
DATA_SOURCE 0 dst $0
DATA_SOURCE 2 count $2
RX_PATH
TASK_NOT_RUNNING
USER_DATA 2 count 2-15[c]
UNITS 2 count unit_byte

kernel/auditsc.c audit_log_execve_info() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 4096-ptr_max
PREEMPT_ADD
RX_PATH
TASK_NOT_RUNNING

mm/kasan/kasan_test_c.c copy_user_test_oob() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 16,4096-ptr_max
PARAM_VALUE 1 src 1-18446744073709551614
PARAM_VALUE 2 count 1-s32max
BUF_SIZE 0 dst 120
BUF_SIZE 0 dst 120
CAPPED_DATA 2 count 1
DATA_SOURCE 0 dst r kunit_kmalloc

kernel/reboot.c __do_sys_reboot() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 7855387142527991808
PARAM_VALUE 2 count 255
BUF_SIZE 0 dst 256
DATA_SOURCE 1 src $3
NS_CAPABLE 0 22
UNITS 2 count unit_byte
LOCK2 global &system_transition_mutex

kernel/reboot.c __do_sys_reboot() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 7855387142527991808
PARAM_VALUE 2 count 255
BUF_SIZE 0 dst 256
DATA_SOURCE 1 src $3
NS_CAPABLE 0 22
UNITS 2 count unit_byte
LOCK2 global &system_transition_mutex

drivers/staging/media/av7110/av7110_hw.c av7110_osd_cmd() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 8999600495489073152
PARAM_VALUE 2 count 240
BUF_SIZE 0 dst 240
LOCK2 &av7110->osd_mutex
TYPE_LOCK (struct av7110)->osd_mutex

security/keys/keyctl.c key_get_type_from_user() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 2762414733690085376,5004652392389177344,7972366221105004544,8891941570754449408
PARAM_VALUE 2 count 32
BUF_SIZE 0 dst 32
BUF_SIZE 0 dst 32
DATA_SOURCE 0 dst $0
DATA_SOURCE 1 src $1
DATA_SOURCE 2 count $2
USER_DATA 1 src 0-u64max
UNITS 2 count unit_byte

drivers/tty/vt/vt.c con_font_default() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 5187111929369022464
PARAM_VALUE 1 src 1-u64max
PARAM_VALUE 2 count 31
BUF_SIZE 0 dst 32

drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c amdgpu_securedisplay_debugfs_write() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 1911763508102672384
PARAM_VALUE 2 count 64
BUF_SIZE 0 dst 64
CAPPED_DATA 1 src 1
DATA_SOURCE 1 src $1
USER_DATA 1 src 0-u64max[c]
UNITS 2 count unit_byte

drivers/gpu/drm/vmwgfx/vmwgfx_msg.c vmw_mksstat_add_ioctl() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 1 src 1-u64max
PARAM_VALUE 2 count 1023
BUF_SIZE 0 dst 1024
UNITS 2 count unit_byte

drivers/gpu/drm/vmwgfx/vmwgfx_msg.c vmw_msg_ioctl() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 4096-ptr_max
PARAM_VALUE 2 count 4096
BUF_SIZE 0 dst 4096
BUF_SIZE 0 dst 4096
DATA_SOURCE 0 dst r _kmalloc_noprof

drivers/dma/xilinx/xilinx_dpdma.c xilinx_dpdma_debugfs_write() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 4096-ptr_max
PARAM_VALUE 2 count 1-4000000
BUF_SIZE 0 dst 1-1000000000,2147479552
BUF_SIZE 0 dst 1-1000000000,2147479552
CAPPED_DATA 1 src 1
DATA_SOURCE 0 dst r _kzalloc_noprof
DATA_SOURCE 1 src $1
DATA_SOURCE 2 count $2
USER_DATA 1 src 0-u64max[c]
USER_DATA 2 count 1-4000000
BYTE_COUNT 0 ==dst2 8050

kernel/trace/trace_uprobe.c fetch_store_string() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 4096-ptr_max
PARAM_VALUE 1 src 0-18446744073709551545,(-69)-(-1)
PARAM_VALUE 2 count 1-u16max
DATA_SOURCE 0 dst r get_loc_data
DATA_SOURCE 1 src $0
RX_PATH
TASK_NOT_RUNNING
USER_DATA 2 count 1-u16max
UNITS 1 src unit_byte
HALF_LOCKED2 &ucb->mutex

kernel/sys.c __do_sys_prctl() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 4096-ptr_max
PARAM_VALUE 2 count 15
BUF_SIZE 0 dst 16
DATA_SOURCE 1 src $1
UNITS 2 count unit_byte

kernel/sys.c __do_sys_prctl() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 4096-ptr_max
PARAM_VALUE 2 count 15
BUF_SIZE 0 dst 16
DATA_SOURCE 1 src $1
UNITS 2 count unit_byte

drivers/accel/ivpu/ivpu_debugfs.c fw_dyndbg_fops_write() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 2953851096729939968
PARAM_VALUE 2 count 0-95
BUF_SIZE 0 dst 96
CAPPED_DATA 1 src 1
DATA_SOURCE 1 src $1
DATA_SOURCE 2 count $2
USER_DATA 1 src 0-u64max[c]
USER_DATA 2 count 0-95

kernel/trace/bpf_trace.c copy_user_str_sleepable() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 1-u64max
PARAM_VALUE 2 count 0-4294967295
BUF_SIZE 0 dst (-1),256
DATA_SOURCE 0 dst $0
DATA_SOURCE 1 src $1
UNITS 2 count unit_byte

kernel/trace/bpf_trace.c copy_user_syms() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 1-u64max
PARAM_VALUE 2 count 512
BUF_SIZE 0 dst 512,u64max
BUF_SIZE 0 dst 512,u64max

mm/memfd.c alloc_name() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 4096-ptr_max
PARAM_VALUE 2 count 250
BUF_SIZE 0 dst 250
DATA_SOURCE 1 src $0
USER_DATA 1 src 0-u64max
UNITS 2 count unit_byte

mm/kmemleak.c kmemleak_write() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 2791708885429686272
PARAM_VALUE 2 count 0-63
BUF_SIZE 0 dst 64
CAPPED_DATA 1 src 1
CAPPED_DATA 2 count 1
DATA_SOURCE 1 src $1
USER_DATA 1 src 0-u64max[c]
USER_DATA 2 count 0-62[c]
UNITS 2 count unit_byte

kernel/bpf/helpers.c bpf_copy_from_user_str() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 2 count 0-4294967295
DATA_SOURCE 0 dst $0
DATA_SOURCE 1 src $2

kernel/module/main.c __do_sys_delete_module() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 3989625535725805568
PARAM_VALUE 2 count 56
BUF_SIZE 0 dst 56
DATA_SOURCE 1 src $0
CAPABLE 0 16
USER_DATA 1 src 0-u64max
UNITS 2 count unit_byte

kernel/module/main.c __do_sys_delete_module() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 3989625535725805568
PARAM_VALUE 2 count 56
BUF_SIZE 0 dst 56
DATA_SOURCE 1 src $0
CAPABLE 0 16
USER_DATA 1 src 0-u64max
UNITS 2 count unit_byte

arch/x86/kernel/cpu/mtrr/if.c mtrr_write() -> strncpy_from_user()

Type Parameter Key Value
PARAM_VALUE 0 dst 7921301992884502528
PARAM_VALUE 2 count 0-79
BUF_SIZE 0 dst 80
CAPPED_DATA 2 count 1
DATA_SOURCE 1 src $1
DATA_SOURCE 2 count $2 [m]
USER_DATA 1 src 0-u64max[c]
USER_DATA 2 count 1-78[c]