From: David Miller <davem@davemloft.net>
To: bblanco@plumgrid.com
Cc: netdev@vger.kernel.org, daniel@iogearbox.net,
alexei.starovoitov@gmail.com, ttoukan.linux@gmail.com,
gerlitz.or@gmail.com, tom@herbertland.com,
saeedm@dev.mellanox.co.il
Subject: Re: [PATCH v2] net/mlx4_en: protect ring->xdp_prog with rcu_read_lock
Date: Tue, 06 Sep 2016 13:42:02 -0700 (PDT) [thread overview]
Message-ID: <20160906.134202.1118614463249936981.davem@davemloft.net> (raw)
In-Reply-To: <20160904042958.8594-1-bblanco@plumgrid.com>
From: Brenden Blanco <bblanco@plumgrid.com>
Date: Sat, 3 Sep 2016 21:29:58 -0700
> Depending on the preempt mode, the bpf_prog stored in xdp_prog may be
> freed despite the use of call_rcu inside bpf_prog_put. The situation is
> possible when running in PREEMPT_RCU=y mode, for instance, since the rcu
> callback for destroying the bpf prog can run even during the bh handling
> in the mlx4 rx path.
>
> Several options were considered before this patch was settled on:
...
> v2:
> Remove extra rcu_read_lock in mlx4_en_process_rx_cq body
> Annotate xdp_prog with __rcu, and convert all usages to rcu_assign or
> rcu_dereference[_protected] as appropriate.
> Add explicit mutex lock around rcu_assign instead of xchg loop.
>
> Fixes: d576acf0a22 ("net/mlx4_en: add page recycle to prepare rx ring for tx support")
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Acked-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
> Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
Applied.
prev parent reply other threads:[~2016-09-06 20:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-04 4:29 [PATCH v2] net/mlx4_en: protect ring->xdp_prog with rcu_read_lock Brenden Blanco
2016-09-06 20:42 ` David Miller [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=20160906.134202.1118614463249936981.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alexei.starovoitov@gmail.com \
--cc=bblanco@plumgrid.com \
--cc=daniel@iogearbox.net \
--cc=gerlitz.or@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@dev.mellanox.co.il \
--cc=tom@herbertland.com \
--cc=ttoukan.linux@gmail.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).