From: David Miller <davem@davemloft.net>
To: lucien.xin@gmail.com
Cc: netdev@vger.kernel.org, shemminger@linux-foundation.org
Subject: Re: [PATCH net] bridge: check brport attr show in brport_show
Date: Mon, 12 Feb 2018 11:19:31 -0500 (EST) [thread overview]
Message-ID: <20180212.111931.1353939040623428981.davem@davemloft.net> (raw)
In-Reply-To: <5c798e132c6635bb9ee309b6c9d63b940944b911.1518426940.git.lucien.xin@gmail.com>
From: Xin Long <lucien.xin@gmail.com>
Date: Mon, 12 Feb 2018 17:15:40 +0800
> Now br_sysfs_if file flush doesn't have attr show. To read it will
> cause kernel panic after users chmod u+r this file.
>
> Xiong found this issue when running the commands:
>
> ip link add br0 type bridge
> ip link add type veth
> ip link set veth0 master br0
> chmod u+r /sys/devices/virtual/net/veth0/brport/flush
> timeout 3 cat /sys/devices/virtual/net/veth0/brport/flush
>
> kernel crashed with NULL a pointer dereference call trace.
>
> This patch is to fix it by return -EINVAL when brport_attr->show
> is null, just the same as the check for brport_attr->store in
> brport_store().
>
> Fixes: 9cf637473c85 ("bridge: add sysfs hook to flush forwarding table")
> Reported-by: Xiong Zhou <xzhou@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Applied and queued up for -stable, thank you.
prev parent reply other threads:[~2018-02-12 16:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 9:15 [PATCH net] bridge: check brport attr show in brport_show Xin Long
2018-02-12 16:19 ` 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=20180212.111931.1353939040623428981.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
/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).