Lines Matching refs:size

174 bpf_probe_read_user_common(void *dst, u32 size, const void __user *unsafe_ptr)  in bpf_probe_read_user_common()  argument
178 ret = copy_from_user_nofault(dst, unsafe_ptr, size); in bpf_probe_read_user_common()
180 memset(dst, 0, size); in bpf_probe_read_user_common()
184 BPF_CALL_3(bpf_probe_read_user, void *, dst, u32, size, in BPF_CALL_3() argument
187 return bpf_probe_read_user_common(dst, size, unsafe_ptr); in BPF_CALL_3()
200 bpf_probe_read_user_str_common(void *dst, u32 size, in bpf_probe_read_user_str_common() argument
215 ret = strncpy_from_user_nofault(dst, unsafe_ptr, size); in bpf_probe_read_user_str_common()
217 memset(dst, 0, size); in bpf_probe_read_user_str_common()
221 BPF_CALL_3(bpf_probe_read_user_str, void *, dst, u32, size, in BPF_CALL_3() argument
224 return bpf_probe_read_user_str_common(dst, size, unsafe_ptr); in BPF_CALL_3()
236 BPF_CALL_3(bpf_probe_read_kernel, void *, dst, u32, size, in BPF_CALL_3() argument
239 return bpf_probe_read_kernel_common(dst, size, unsafe_ptr); in BPF_CALL_3()
252 bpf_probe_read_kernel_str_common(void *dst, u32 size, const void *unsafe_ptr) in bpf_probe_read_kernel_str_common() argument
265 ret = strncpy_from_kernel_nofault(dst, unsafe_ptr, size); in bpf_probe_read_kernel_str_common()
267 memset(dst, 0, size); in bpf_probe_read_kernel_str_common()
271 BPF_CALL_3(bpf_probe_read_kernel_str, void *, dst, u32, size, in BPF_CALL_3() argument
274 return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr); in BPF_CALL_3()
287 BPF_CALL_3(bpf_probe_read_compat, void *, dst, u32, size, in BPF_CALL_3() argument
291 return bpf_probe_read_user_common(dst, size, in BPF_CALL_3()
294 return bpf_probe_read_kernel_common(dst, size, unsafe_ptr); in BPF_CALL_3()
306 BPF_CALL_3(bpf_probe_read_compat_str, void *, dst, u32, size, in BPF_CALL_3() argument
310 return bpf_probe_read_user_str_common(dst, size, in BPF_CALL_3()
313 return bpf_probe_read_kernel_str_common(dst, size, unsafe_ptr); in BPF_CALL_3()
327 u32, size) in BPF_CALL_3() argument
348 return copy_to_user_nofault(unsafe_ptr, src, size); in BPF_CALL_3()
584 struct bpf_perf_event_value *, buf, u32, size) in BPF_CALL_4() argument
588 if (unlikely(size != sizeof(struct bpf_perf_event_value))) in BPF_CALL_4()
596 memset(buf, 0, size); in BPF_CALL_4()
659 u64, flags, void *, data, u64, size) in BPF_CALL_5() argument
664 .size = size, in BPF_CALL_5()
719 .size = ctx_size, in bpf_event_output()
727 .size = meta_size, in bpf_event_output()
1171 BPF_CALL_3(bpf_get_branch_snapshot, void *, buf, u32, size, u64, flags) in BPF_CALL_3() argument
1174 u32 entry_cnt = size / br_entry_size; in BPF_CALL_3()
1518 static bool kprobe_prog_is_valid_access(int off, int size, enum bpf_access_type type, in kprobe_prog_is_valid_access() argument
1526 if (off % size != 0) in kprobe_prog_is_valid_access()
1532 if (off + size > sizeof(struct pt_regs)) in kprobe_prog_is_valid_access()
1547 u64, flags, void *, data, u64, size) in BPF_CALL_5() argument
1556 return ____bpf_perf_event_output(regs, map, flags, data, size); in BPF_CALL_5()
1593 BPF_CALL_4(bpf_get_stack_tp, void *, tp_buff, void *, buf, u32, size, in BPF_CALL_4() argument
1599 (unsigned long) size, flags, 0); in BPF_CALL_4()
1629 static bool tp_prog_is_valid_access(int off, int size, enum bpf_access_type type, in tp_prog_is_valid_access() argument
1637 if (off % size != 0) in tp_prog_is_valid_access()
1653 struct bpf_perf_event_value *, buf, u32, size) in BPF_CALL_3() argument
1657 if (unlikely(size != sizeof(struct bpf_perf_event_value))) in BPF_CALL_3()
1665 memset(buf, 0, size); in BPF_CALL_3()
1679 void *, buf, u32, size, u64, flags) in BPF_CALL_4() argument
1697 if (!buf || (size % br_entry_size != 0)) in BPF_CALL_4()
1700 to_copy = min_t(u32, br_stack->nr * br_entry_size, size); in BPF_CALL_4()
1769 struct bpf_map *, map, u64, flags, void *, data, u64, size) in BPF_CALL_5() argument
1778 ret = ____bpf_perf_event_output(regs, map, flags, data, size); in BPF_CALL_5()
1826 void *, buf, u32, size, u64, flags) in BPF_CALL_4() argument
1836 (unsigned long) size, flags, 0); in BPF_CALL_4()
1937 static bool raw_tp_prog_is_valid_access(int off, int size, in raw_tp_prog_is_valid_access() argument
1942 return bpf_tracing_ctx_access(off, size, type); in raw_tp_prog_is_valid_access()
1945 static bool tracing_prog_is_valid_access(int off, int size, in tracing_prog_is_valid_access() argument
1950 return bpf_tracing_btf_ctx_access(off, size, type, prog, info); in tracing_prog_is_valid_access()
1980 static bool raw_tp_writable_prog_is_valid_access(int off, int size, in raw_tp_writable_prog_is_valid_access() argument
1986 if (size != sizeof(u64) || type != BPF_READ) in raw_tp_writable_prog_is_valid_access()
1990 return raw_tp_prog_is_valid_access(off, size, type, prog, info); in raw_tp_writable_prog_is_valid_access()
2001 static bool pe_prog_is_valid_access(int off, int size, enum bpf_access_type type, in pe_prog_is_valid_access() argument
2011 if (off % size != 0) { in pe_prog_is_valid_access()
2014 if (size != 8) in pe_prog_is_valid_access()
2016 if (off % size != 4) in pe_prog_is_valid_access()
2023 if (!bpf_ctx_narrow_access_ok(off, size, size_u64)) in pe_prog_is_valid_access()
2028 if (!bpf_ctx_narrow_access_ok(off, size, size_u64)) in pe_prog_is_valid_access()
2032 if (size != sizeof(long)) in pe_prog_is_valid_access()
2654 static void bpf_kprobe_multi_cookie_swap(void *a, void *b, int size, const void *priv) in bpf_kprobe_multi_cookie_swap() argument
2790 static void symbols_swap_r(void *a, void *b, int size, const void *priv) in symbols_swap_r() argument
2900 u32 flags, cnt, size; in bpf_kprobe_multi_link_attach() local
2931 size = cnt * sizeof(*addrs); in bpf_kprobe_multi_link_attach()
2943 if (copy_from_user(cookies, ucookies, size)) { in bpf_kprobe_multi_link_attach()
2950 if (copy_from_user(addrs, uaddrs, size)) { in bpf_kprobe_multi_link_attach()
3539 typedef int (*copy_fn_t)(void *dst, const void *src, u32 size, struct task_struct *tsk);
3548 static __always_inline int __bpf_dynptr_copy_str(struct bpf_dynptr *dptr, u32 doff, u32 size, in __bpf_dynptr_copy_str() argument
3559 dst_slice = bpf_dynptr_slice_rdwr(dptr, doff, NULL, size); in __bpf_dynptr_copy_str()
3561 return str_copy_fn(dst_slice, unsafe_src, size, tsk); in __bpf_dynptr_copy_str()
3564 if (bpf_dynptr_check_off_len(dst, doff, size)) in __bpf_dynptr_copy_str()
3567 for (off = 0; off < size; off += chunk_sz - 1) { in __bpf_dynptr_copy_str()
3568 chunk_sz = min_t(u32, sizeof(buf), size - off); in __bpf_dynptr_copy_str()
3586 u32 size, const void *unsafe_src, in __bpf_dynptr_copy() argument
3595 dst_slice = bpf_dynptr_slice_rdwr(dptr, doff, NULL, size); in __bpf_dynptr_copy()
3597 return copy_fn(dst_slice, unsafe_src, size, tsk); in __bpf_dynptr_copy()
3600 if (bpf_dynptr_check_off_len(dst, doff, size)) in __bpf_dynptr_copy()
3603 for (off = 0; off < size; off += chunk_sz) { in __bpf_dynptr_copy()
3604 chunk_sz = min_t(u32, sizeof(buf), size - off); in __bpf_dynptr_copy()
3616 u32 size, struct task_struct *tsk) in copy_user_data_nofault() argument
3618 return copy_from_user_nofault(dst, (const void __user *)unsafe_src, size); in copy_user_data_nofault()
3622 u32 size, struct task_struct *tsk) in copy_user_data_sleepable() argument
3627 ret = copy_from_user(dst, (const void __user *)unsafe_src, size); in copy_user_data_sleepable()
3633 ret = access_process_vm(tsk, (unsigned long)unsafe_src, dst, size, 0); in copy_user_data_sleepable()
3634 if (ret != size) in copy_user_data_sleepable()
3640 u32 size, struct task_struct *tsk) in copy_kernel_data_nofault() argument
3642 return copy_from_kernel_nofault(dst, unsafe_src, size); in copy_kernel_data_nofault()
3646 u32 size, struct task_struct *tsk) in copy_user_str_nofault() argument
3648 return strncpy_from_user_nofault(dst, (const void __user *)unsafe_src, size); in copy_user_str_nofault()
3652 u32 size, struct task_struct *tsk) in copy_user_str_sleepable() argument
3656 if (unlikely(size == 0)) in copy_user_str_sleepable()
3660 ret = copy_remote_vm_str(tsk, (unsigned long)unsafe_src, dst, size, 0); in copy_user_str_sleepable()
3662 ret = strncpy_from_user(dst, (const void __user *)unsafe_src, size - 1); in copy_user_str_sleepable()
3674 u32 size, struct task_struct *tsk) in copy_kernel_str_nofault() argument
3676 return strncpy_from_kernel_nofault(dst, unsafe_src, size); in copy_kernel_str_nofault()
3691 u32 size, const void __user *unsafe_ptr__ign) in bpf_probe_read_user_dynptr() argument
3693 return __bpf_dynptr_copy(dptr, off, size, (const void *)unsafe_ptr__ign, in bpf_probe_read_user_dynptr()
3698 u32 size, const void *unsafe_ptr__ign) in bpf_probe_read_kernel_dynptr() argument
3700 return __bpf_dynptr_copy(dptr, off, size, unsafe_ptr__ign, in bpf_probe_read_kernel_dynptr()
3705 u32 size, const void __user *unsafe_ptr__ign) in bpf_probe_read_user_str_dynptr() argument
3707 return __bpf_dynptr_copy_str(dptr, off, size, (const void *)unsafe_ptr__ign, in bpf_probe_read_user_str_dynptr()
3712 u32 size, const void *unsafe_ptr__ign) in bpf_probe_read_kernel_str_dynptr() argument
3714 return __bpf_dynptr_copy_str(dptr, off, size, unsafe_ptr__ign, in bpf_probe_read_kernel_str_dynptr()
3719 u32 size, const void __user *unsafe_ptr__ign) in bpf_copy_from_user_dynptr() argument
3721 return __bpf_dynptr_copy(dptr, off, size, (const void *)unsafe_ptr__ign, in bpf_copy_from_user_dynptr()
3726 u32 size, const void __user *unsafe_ptr__ign) in bpf_copy_from_user_str_dynptr() argument
3728 return __bpf_dynptr_copy_str(dptr, off, size, (const void *)unsafe_ptr__ign, in bpf_copy_from_user_str_dynptr()
3733 u32 size, const void __user *unsafe_ptr__ign, in bpf_copy_from_user_task_dynptr() argument
3736 return __bpf_dynptr_copy(dptr, off, size, (const void *)unsafe_ptr__ign, in bpf_copy_from_user_task_dynptr()
3741 u32 size, const void __user *unsafe_ptr__ign, in bpf_copy_from_user_task_str_dynptr() argument
3744 return __bpf_dynptr_copy_str(dptr, off, size, (const void *)unsafe_ptr__ign, in bpf_copy_from_user_task_str_dynptr()