netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf v4 0/2] Fix verifier id tracking of scalars on spill
@ 2023-06-07 12:39 Maxim Mikityanskiy
  2023-06-07 12:39 ` [PATCH bpf v4 1/2] bpf: " Maxim Mikityanskiy
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Maxim Mikityanskiy @ 2023-06-07 12:39 UTC (permalink / raw)
  To: bpf
  Cc: netdev, linux-kselftest, Daniel Borkmann, John Fastabend,
	Alexei Starovoitov, Andrii Nakryiko, Martin KaFai Lau,
	Eduard Zingerman, Maxim Mikityanskiy, Song Liu, Yonghong Song,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan, David S. Miller, Jakub Kicinski,
	Jesper Dangaard Brouer

From: Maxim Mikityanskiy <maxim@isovalent.com>

See the details in the commit message (TL/DR: under CAP_BPF, the
verifier can incorrectly conclude that a scalar is zero while in
fact it can be crafted to a predefined number.)

v1 and v2 were sent off-list.

v2 changes:

Added more tests, migrated them to inline asm, started using
bpf_get_prandom_u32, switched to a more bulletproof dead branch check
and modified the failing spill test scenarios so that an unauthorized
access attempt is performed in both branches.

v3 changes:

Dropped an improvement not necessary for the fix, changed the Fixes tag.

v4 changes:

Dropped supposedly redundant tests, kept the ones that result in
different verifier verdicts. Dropped the variable that is not yet
useful in this patch. Rephrased the commit message with Daniel's
suggestions.

Maxim Mikityanskiy (2):
  bpf: Fix verifier id tracking of scalars on spill
  selftests/bpf: Add test cases to assert proper ID tracking on spill

 kernel/bpf/verifier.c                         |  3 +
 .../selftests/bpf/progs/verifier_spill_fill.c | 79 +++++++++++++++++++
 2 files changed, 82 insertions(+)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-08 11:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07 12:39 [PATCH bpf v4 0/2] Fix verifier id tracking of scalars on spill Maxim Mikityanskiy
2023-06-07 12:39 ` [PATCH bpf v4 1/2] bpf: " Maxim Mikityanskiy
2023-06-07 12:39 ` [PATCH bpf v4 2/2] selftests/bpf: Add test cases to assert proper ID tracking " Maxim Mikityanskiy
2023-06-07 15:35   ` Yonghong Song
2023-06-08 11:21 ` [PATCH bpf v4 0/2] Fix verifier id tracking of scalars " Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).