netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net, andriin@fb.com
Cc: john.fastabend@gmail.com, bpf@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH bpf v2 0/2] bpf, fix for subprogs with tailcalls
Date: Wed,  7 Jul 2021 15:38:46 -0700	[thread overview]
Message-ID: <20210707223848.14580-1-john.fastabend@gmail.com> (raw)

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


             reply	other threads:[~2021-07-07 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 22:38 John Fastabend [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210707223848.14580-1-john.fastabend@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).