> -----Original Message-----
> From: Jakub Kicinski [mailto:k...@kernel.org]
> Sent: Tuesday, January 5, 2021 5:35 AM
> To: wangyunjian <wangyunj...@huawei.com>
> Cc: netdev@vger.kernel.org; da...@davemloft.net; Lilijun (Jerry)
> <jerry.lili...@huawei.com>; xudingke <xudin...@huawei.com>
> Subject: Re: [PATCH net] macvlan: fix null pointer dereference in
> macvlan_changelink_sources()
> 
> On Wed, 30 Dec 2020 18:38:15 +0800 wangyunjian wrote:
> > From: Yunjian Wang <wangyunj...@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 <wangyunj...@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?

OK, thanks for your suggestion, will include them in next version.

Yunjian

Reply via email to