Merge branch 'fix-leftover-issues-of-the-unify-bpf_call_arg_meta-patchset'

Amery Hung says:

====================
Fix leftover issues of the unify bpf_call_arg_meta patchset

Hi,

This patchset fixes preexisting issues flagged by Sashiko when reviewing
the patchset unifying bpf_call_arg_meta [0].

[0] https://lore.kernel.org/bpf/20260715064047.1793790-1-ameryhung@gmail.com/
====================

Link: https://patch.msgid.link/20260715172127.2416388-1-ameryhung@gmail.com
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
This commit is contained in:
Eduard Zingerman
2026-07-16 17:51:53 -07:00

View File

@@ -8418,6 +8418,15 @@ static int check_func_arg(struct bpf_verifier_env *env, u32 arg,
verifier_bug(env, "invalid map_ptr to access map->value");
return -EFAULT;
}
/*
* Disable raw mode for bpf_map_peek_elem() on a bloom filter. The helper reads
* the value buffer as an input rather than filling it.
*/
if (meta->func_id == BPF_FUNC_map_peek_elem &&
meta->map.ptr->map_type == BPF_MAP_TYPE_BLOOM_FILTER)
meta->arg_raw_mem.regno = 0;
err = check_helper_mem_access(env, reg, argno, meta->map.ptr->value_size,
arg_type & MEM_WRITE ? BPF_WRITE : BPF_READ,
false, meta);
@@ -12558,11 +12567,12 @@ int bpf_fetch_kfunc_arg_meta(struct bpf_verifier_env *env,
struct bpf_kfunc_meta kfunc;
int err;
memset(meta, 0, sizeof(*meta));
err = fetch_kfunc_meta(env, func_id, offset, &kfunc);
if (err)
return err;
memset(meta, 0, sizeof(*meta));
meta->btf = kfunc.btf;
meta->func_id = kfunc.id;
meta->func_proto = kfunc.proto;