bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allan Zhang <allanzhang@google.com>
To: daniel@iogearbox.net, songliubraving@fb.com,
	netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Allan Zhang <allanzhang@google.com>
Subject: [PATCH 0/1] bpf: Fix bpf_event_output re-entry issue
Date: Wed, 25 Sep 2019 16:43:11 -0700	[thread overview]
Message-ID: <20190925234312.94063-1-allanzhang@google.com> (raw)

BPF_PROG_TYPE_SOCK_OPS program can reenter bpf_event_output because it can
be called from atomic and non-atomic contexts since we don't have
bpf_prog_active to prevent it happen.

This patch enables 3 level of nesting to support normal, irq and nmi
context.

We can easily reproduce the issue by running neper crr mode with 100 flows
and 10 threads from neper client side.

Allan Zhang (1):
  bpf: Fix bpf_event_output re-entry issue

 kernel/trace/bpf_trace.c | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

-- 
2.23.0.351.gc4317032e6-goog


             reply	other threads:[~2019-09-25 23:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 23:43 Allan Zhang [this message]
2019-09-25 23:43 ` [PATCH 1/1] bpf: Fix bpf_event_output re-entry issue Allan Zhang
2019-09-26 16:20   ` John Fastabend
2019-09-27 12:44   ` Daniel Borkmann

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=20190925234312.94063-1-allanzhang@google.com \
    --to=allanzhang@google.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    /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).