bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: maciej.fijalkowski@intel.com, 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 0/2] bpf, fix for subprogs with tailcalls
Date: Wed, 30 Jun 2021 12:40:47 -0700	[thread overview]
Message-ID: <20210630194049.46453-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.

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                         | 39 ++++---------------
 .../selftests/bpf/prog_tests/tailcalls.c      | 36 ++++++++++++-----
 .../selftests/bpf/progs/tailcall_bpf2bpf4.c   | 21 +++++++++-
 6 files changed, 64 insertions(+), 44 deletions(-)

-- 
2.25.1


             reply	other threads:[~2021-06-30 19:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30 19:40 John Fastabend [this message]
2021-06-30 19:40 ` [PATCH bpf 1/2] bpf: track subprog poke correctly, fix use-after-free John Fastabend
2021-07-06  8:10   ` Daniel Borkmann
2021-06-30 19:40 ` [PATCH bpf 2/2] bpf: selftest to verify mixing bpf2bpf calls and tailcalls with insn patch 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=20210630194049.46453-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=maciej.fijalkowski@intel.com \
    --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).