]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix inner map state pruning regression.
authorAlexei Starovoitov <ast@kernel.org>
Wed, 10 Nov 2021 17:25:56 +0000 (09:25 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 12 Nov 2021 15:19:40 +0000 (16:19 +0100)
commit86563912aca542acd845ab858191fe5d138c34db
tree668f5685d99490a5db621c97cf3c6f68a4529642
parent507244a361713ad8a6c9b4c8600f551b5d24fa30
bpf: Fix inner map state pruning regression.

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.

Fixes: 6d640d971c86 ("bpf: Prevent pointer mismatch in bpf_timer_init.")
Reported-by: Lorenz Bauer <lmb@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Lorenz Bauer <lmb@cloudflare.com>
Link: https://lore.kernel.org/bpf/CACAyw99hVEJFoiBH_ZGyy=+oO-jyydoz6v1DeKPKs2HVsUH28w@mail.gmail.com
Link: https://lore.kernel.org/bpf/20211110172556.20754-1-alexei.starovoitov@gmail.com
kernel/bpf/verifier.c