bpf: Fix inner map state pruning regression.
Subsystems (4)
PATCH 1/1 bpf: Fix inner map state pruning regression.
From: Alexei Starovoitov <[email protected]>
Introduction of map_uid made two lookups from outer map to be distinct. That distinction is only necessary when inner map has an embedded timer. Otherwise it will make the verifier state pruning to be conservative which will cause complex programs to hit 1M insn_processed limit. Tighten map_uid logic to apply to inner maps with timers only.
--- kernel/bpf/verifier.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/bpf/verifier.c +2 -1
@@ -1151,7 +1151,8 @@ static void mark_ptr_not_null_reg(struct bpf_reg_state *reg)/* transfer reg's id which is unique for every map_lookup_elem * as UID of the inner map. */ - reg->map_uid = reg->id; +if (map_value_has_timer (map->inner_map_meta)) + reg->map_uid = reg->id; }else if (map->map_type ==BPF_MAP_TYPE_XSKMAP ) { reg->type =PTR_TO_XDP_SOCK ; } else if (map->map_type == BPF_MAP_TYPE_SOCKMAP ||
Signature · 1 line
2.30.2
This patch was applied to bpf/bpf.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <[email protected]>:
Quoted 9 lines · On Wed, 10 Nov 2021 09:25:56 -0800 you wrote:
From: Alexei Starovoitov <[email protected]>
Introduction of
map_uidmade two lookups from outer map to be distinct. That distinction is only necessary when inner map has an embedded timer. Otherwise it will make the verifier state pruning to be conservative which will cause complex programs to hit 1Minsn_processedlimit. Tightenmap_uidlogic to apply to inner maps with timers only.[...]
Here is the summary with links:
- [bpf] bpf: Fix inner map state pruning regression.
https://git.kernel.org/bpf/bpf/c/b5634057b30f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html