]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: make liveness.c track stack with 4-byte granularity
authorEduard Zingerman <eddyz87@gmail.com>
Fri, 10 Apr 2026 20:55:55 +0000 (13:55 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 10 Apr 2026 22:04:56 +0000 (15:04 -0700)
commit7ca5f68cda073a6c4aa6135e98a27c7b2a731cdd
treee879d963ede17fce051ffc60ca99ec79dbbafd50
parent2ad45b414b8779ba5c50f746fd767926cccde729
bpf: make liveness.c track stack with 4-byte granularity

Convert liveness bitmask type from u64 to spis_t, doubling the number
of trackable stack slots from 64 to 128 to support 4-byte granularity.

Each 8-byte SPI now maps to two consecutive 4-byte sub-slots in the
bitmask: spi*2 half and spi*2+1 half. In verifier.c,
check_stack_write_fixed_off() now reports 4-byte aligned writes of
4-byte writes as half-slot marks and 8-byte aligned 8-byte writes as
two slots. Similar logic applied in check_stack_read_fixed_off().

Queries (is_live_before) are not yet migrated to half-slot
granularity.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20260410-patch-set-v4-4-5d4eecb343db@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf_verifier.h
kernel/bpf/liveness.c
kernel/bpf/verifier.c