All of lore.kernel.org
 help / color / mirror / Atom feed
* [bpf-next PATCH 0/4] verifier, improve ptr is_branch_taken logic
@ 2020-05-18 20:02 John Fastabend
  2020-05-18 20:02 ` [bpf-next PATCH 1/4] bpf: verifier track null pointer branch_taken with JNE and JEQ John Fastabend
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: John Fastabend @ 2020-05-18 20:02 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, bpf, john.fastabend

Verifier logic to track pointer is_branch_taken logic to prune paths
that can not be taken. For many types we track if the pointer is null
or not. We can then use this information when calculating if branches
are taken when jump is comparing if pointer is null or not.

First patch is the verifier logic, patches 2/3 are tests for sock
pointers and map values. The final patch adds a printk to one of
the C test cases where the issue was initially reported. Feel free
to drop this if we think its overkill. OTOH it keeps a nice test
of a pattern folks might actually try and also doesn't add much in
the way of test overhead.

---

John Fastabend (4):
      bpf: verifier track null pointer branch_taken with JNE and JEQ
      bpf: selftests, verifier case for non null pointer check branch taken
      bpf: selftests, verifier case for non null pointer map value branch
      bpf: selftests, add printk to test_sk_lookup_kern to encode null ptr check


 .../selftests/bpf/progs/test_sk_lookup_kern.c      |    1 +
 .../testing/selftests/bpf/verifier/ref_tracking.c  |   16 ++++++++++++++++
 .../testing/selftests/bpf/verifier/value_or_null.c |   19 +++++++++++++++++++
 3 files changed, 36 insertions(+)

--
Signature

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

end of thread, other threads:[~2020-05-19  5:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 20:02 [bpf-next PATCH 0/4] verifier, improve ptr is_branch_taken logic John Fastabend
2020-05-18 20:02 ` [bpf-next PATCH 1/4] bpf: verifier track null pointer branch_taken with JNE and JEQ John Fastabend
2020-05-18 20:35   ` John Fastabend
2020-05-19  5:02   ` Andrii Nakryiko
2020-05-19  5:34     ` John Fastabend
2020-05-18 20:02 ` [bpf-next PATCH 2/4] bpf: selftests, verifier case for non null pointer check branch taken John Fastabend
2020-05-19  5:05   ` Andrii Nakryiko
2020-05-18 20:03 ` [bpf-next PATCH 3/4] bpf: selftests, verifier case for non null pointer map value branch John Fastabend
2020-05-19  5:08   ` Andrii Nakryiko
2020-05-18 20:03 ` [bpf-next PATCH 4/4] bpf: selftests, add printk to test_sk_lookup_kern to encode null ptr check John Fastabend
2020-05-19  5:06   ` Andrii Nakryiko
2020-05-19  5:03 ` [bpf-next PATCH 0/4] verifier, improve ptr is_branch_taken logic Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.