bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf v2 0/2] bpf, fix for subprogs with tailcalls
@ 2021-07-07 22:38 John Fastabend
  2021-07-07 22:38 ` [PATCH bpf v2 1/2] bpf: track subprog poke correctly, fix use-after-free John Fastabend
  2021-07-07 22:38 ` [PATCH bpf v2 2/2] bpf: selftest to verify mixing bpf2bpf calls and tailcalls with insn patch John Fastabend
  0 siblings, 2 replies; 5+ messages in thread
From: John Fastabend @ 2021-07-07 22:38 UTC (permalink / raw)
  To: ast, daniel, andriin; +Cc: john.fastabend, bpf, netdev

This fixes a use-after-free when using subprogs and tailcalls and adds
a test case to trigger the use-after-free.

v2: original patch missed fixups needed in out label as Daniel caught 

John Fastabend (2):
  bpf: track subprog poke correctly, fix use-after-free
  bpf: selftest to verify mixing bpf2bpf calls and tailcalls with insn
    patch

 arch/x86/net/bpf_jit_comp.c                   |  4 ++
 include/linux/bpf.h                           |  1 +
 kernel/bpf/core.c                             |  7 ++-
 kernel/bpf/verifier.c                         | 45 ++++---------------
 .../selftests/bpf/prog_tests/tailcalls.c      | 36 ++++++++++-----
 .../selftests/bpf/progs/tailcall_bpf2bpf4.c   | 21 ++++++++-
 6 files changed, 65 insertions(+), 49 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2021-07-08 20:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 22:38 [PATCH bpf v2 0/2] bpf, fix for subprogs with tailcalls John Fastabend
2021-07-07 22:38 ` [PATCH bpf v2 1/2] bpf: track subprog poke correctly, fix use-after-free John Fastabend
2021-07-07 22:38 ` [PATCH bpf v2 2/2] bpf: selftest to verify mixing bpf2bpf calls and tailcalls with insn patch John Fastabend
2021-07-08  4:05   ` Alexei Starovoitov
2021-07-08 20:42     ` John Fastabend

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).