netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: netdev@vger.kernel.org, roopa@cumulusnetworks.com,
	davem@davemloft.net, bridge@lists.linux-foundation.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH net v3] net: bridge: fix vlan stats use-after-free on destruction
Date: Wed, 20 May 2020 08:50:54 -0700	[thread overview]
Message-ID: <20200520085054.2031ad8a@hermes.lan> (raw)
In-Reply-To: <20181116165001.30896-1-nikolay@cumulusnetworks.com>

On Fri, 16 Nov 2018 18:50:01 +0200
Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:

> +	if (v->priv_flags & BR_VLFLAG_PER_PORT_STATS)
>  		free_percpu(v->stats);

Why not not v->stats == NULL as a flag instead?

Then the fact that free_percpu(NULL) is a Nop would mean less code
in the bridge driver.

      parent reply	other threads:[~2020-05-20 15:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12  5:51 KASAN: use-after-free Read in nbp_vlan_rcu_free syzbot
2018-11-12  8:32 ` nikolay
2018-11-13  1:01 ` [PATCH net] net: bridge: fix per-port vlan stats use-after-free on destruction Nikolay Aleksandrov
2018-11-14 17:08   ` Nikolay Aleksandrov
2018-11-14 17:27     ` [PATCH net v2] net: bridge: fix " Nikolay Aleksandrov
2018-11-16 16:50       ` [PATCH net v3] " Nikolay Aleksandrov
2018-11-18  5:39         ` David Miller
2020-04-24  0:05         ` Stephen Hemminger
2020-04-24  7:26           ` Nikolay Aleksandrov
2020-05-20 15:50         ` Stephen Hemminger [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=20200520085054.2031ad8a@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=syzkaller-bugs@googlegroups.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).