netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: wangyunjian <wangyunjian@huawei.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
	<jerry.lilijun@huawei.com>, <xudingke@huawei.com>
Subject: Re: [PATCH net] macvlan: fix null pointer dereference in macvlan_changelink_sources()
Date: Mon, 4 Jan 2021 13:35:17 -0800	[thread overview]
Message-ID: <20210104133517.68198ccd@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <1609324695-1516-1-git-send-email-wangyunjian@huawei.com>

On Wed, 30 Dec 2020 18:38:15 +0800 wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> Currently pointer data is dereferenced when declaring addr before
> pointer data is null checked. This could lead to a null pointer
> dereference. Fix this by checking if pointer data is null first.
> 
> Fixes: 79cf79abce71 ("macvlan: add source mode")
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>

I don't see it. All calls to macvlan_changelink_sources() are under 
if (data) { ... } so data is never NULL. Looks like we should rather
clean up macvlan_changelink_sources() to not check data for
MACVLAN_MACADDR_SET. 

WDYT?

  reply	other threads:[~2021-01-04 21:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 10:38 [PATCH net] macvlan: fix null pointer dereference in macvlan_changelink_sources() wangyunjian
2021-01-04 21:35 ` Jakub Kicinski [this message]
2021-01-05  6:36   ` wangyunjian

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=20210104133517.68198ccd@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=jerry.lilijun@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=wangyunjian@huawei.com \
    --cc=xudingke@huawei.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).