netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Alexei Starovoitov <ast@kernel.org>, davem@davemloft.net
Cc: peterz@infradead.org, jannh@google.com, paulmck@linux.ibm.com,
	will.deacon@arm.com, mingo@redhat.com, netdev@vger.kernel.org,
	kernel-team@fb.com
Subject: Re: [PATCH bpf] bpf: run bpf programs with preemption disabled
Date: Thu, 31 Jan 2019 23:24:19 +0100	[thread overview]
Message-ID: <a2338f78-8f0c-2cdb-f040-bf0040ca6522@iogearbox.net> (raw)
In-Reply-To: <20190129024334.1100196-1-ast@kernel.org>

On 01/29/2019 03:43 AM, Alexei Starovoitov wrote:
> Disabled preemption is necessary for proper access to per-cpu maps
> from BPF programs.
> 
> But the sender side of socket filters didn't have preemption disabled:
> unix_dgram_sendmsg->sk_filter->sk_filter_trim_cap->bpf_prog_run_save_cb->BPF_PROG_RUN
> 
> and a combination of af_packet with tun device didn't disable either:
> tpacket_snd->packet_direct_xmit->packet_pick_tx_queue->ndo_select_queue->
>   tun_select_queue->tun_ebpf_select_queue->bpf_prog_run_clear_cb->BPF_PROG_RUN
> 
> Disable preemption before executing BPF programs (both classic and extended).
> 
> Reported-by: Jann Horn <jannh@google.com>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Applied, thanks!

      parent reply	other threads:[~2019-01-31 22:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  2:43 [PATCH bpf] bpf: run bpf programs with preemption disabled Alexei Starovoitov
2019-01-29  7:01 ` Song Liu
2019-01-31 22:24 ` Daniel Borkmann [this message]

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=a2338f78-8f0c-2cdb-f040-bf0040ca6522@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jannh@google.com \
    --cc=kernel-team@fb.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@linux.ibm.com \
    --cc=peterz@infradead.org \
    --cc=will.deacon@arm.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).