On Mon, 2024-09-30 at 15:00 -0700, Andrii Nakryiko wrote: [...] > Right now, the only way to pass dynamically sized anything is through > dynptr, AFAIU. But we do have 'is_kfunc_arg_mem_size()' that checks for __sz suffix, e.g. used for bpf_copy_from_user_str(): /** * bpf_copy_from_user_str() - Copy a string from an unsafe user address * @dst: Destination address, in kernel space. This buffer must be * at least @dst__sz bytes long. * @dst__sz: Maximum number of bytes to copy, includes the trailing NUL. * ... */ __bpf_kfunc int bpf_copy_from_user_str(void *dst, u32 dst__sz, const void __user *unsafe_ptr__ign, u64 flags) However, this suffix won't work for strnstr because of the arguments order. [...]