All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: daniel@iogearbox.net
Cc: jakub.kicinski@netronome.com, netdev@vger.kernel.org,
	oss-drivers@netronome.com, xiyou.wangcong@gmail.com
Subject: Re: [PATCH net] cls_bpf: don't decrement net's refcount when offload fails
Date: Tue, 28 Nov 2017 15:50:09 -0500 (EST)	[thread overview]
Message-ID: <20171128.155009.643947779652971751.davem@davemloft.net> (raw)
In-Reply-To: <9a326b7b-d80c-9d52-aba5-128dcd5b7778@iogearbox.net>

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon, 27 Nov 2017 22:09:33 +0100

> On 11/27/2017 08:11 PM, Jakub Kicinski wrote:
>> When cls_bpf offload was added it seemed like a good idea to
>> call cls_bpf_delete_prog() instead of extending the error
>> handling path, since the software state is fully initialized
>> at that point.  This handling of errors without jumping to
>> the end of the function is error prone, as proven by later
>> commit missing that extra call to __cls_bpf_delete_prog().
>> 
>> __cls_bpf_delete_prog() is now expected to be invoked with
>> a reference on exts->net or the field zeroed out.  The call
>> on the offload's error patch does not fullfil this requirement,
>> leading to each error stealing a reference on net namespace.
>> 
>> Create a function undoing what cls_bpf_set_parms() did and
>> use it from __cls_bpf_delete_prog() and the error path.
>> 
>> Fixes: aae2c35ec892 ("cls_bpf: use tcf_exts_get_net() before call_rcu()")
>> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>> Reviewed-by: Simon Horman <simon.horman@netronome.com>
> 
> Fix looks good to me, thanks Jakub! If Dave wants to take
> it directly:
> 
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>

Applied and queued up for -stable, thanks everyone.

  reply	other threads:[~2017-11-28 20:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 19:11 [PATCH net] cls_bpf: don't decrement net's refcount when offload fails Jakub Kicinski
2017-11-27 21:09 ` Daniel Borkmann
2017-11-28 20:50   ` David Miller [this message]
2017-11-28 18:19 ` Cong Wang

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=20171128.155009.643947779652971751.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=xiyou.wangcong@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.