]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: bpf: Add test for multiple syncs from linked register
authorPuranjay Mohan <puranjay@kernel.org>
Thu, 15 Jan 2026 15:11:41 +0000 (07:11 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 16 Jan 2026 18:08:59 +0000 (10:08 -0800)
commit086c99fbe45070d02851427eab5ae26fe7d0f3c0
treecb171dde5e450288a3fd77a160ee63c3cd149208
parentaf9e89d8dd39530c8bd14c33ddf6b502df1071b6
selftests: bpf: Add test for multiple syncs from linked register

Before the last commit, sync_linked_regs() corrupted the register whose
bounds are being updated by copying known_reg's id to it. The ids are
the same in value but known_reg has the BPF_ADD_CONST flag which is
wrongly copied to reg.

This later causes issues when creating new links to this reg.
assign_scalar_id_before_mov() sees this BPF_ADD_CONST and gives a new id
to this register and breaks the old links. This is exposed by the added
selftest.

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Tested-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20260115151143.1344724-3-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/verifier_linked_scalars.c