netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: girish.moodalbail@oracle.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net 0/2] NULL pointer dereference in {ipvlan|macvlan}_port_destroy
Date: Fri, 03 Nov 2017 14:05:11 +0900 (KST)	[thread overview]
Message-ID: <20171103.140511.953424236476363454.davem@davemloft.net> (raw)
In-Reply-To: <1509467987-20050-1-git-send-email-girish.moodalbail@oracle.com>

From: Girish Moodalbail <girish.moodalbail@oracle.com>
Date: Tue, 31 Oct 2017 09:39:45 -0700

> When call to register_netdevice() (called from ipvlan_link_new())
> fails, inside that function we call ipvlan_uninit() (through
> ndo_uninit()) to destroy the ipvlan port. Upon returning
> unsuccessfully from register_netdevice() we go ahead and call
> ipvlan_port_destroy() again which causes NULL pointer dereference
> panic.

The problem is that ipvlan doesn't follow the proper convention that
->ndo_uninit() must only release resources allocated by ->ndo_init().

What needs to happen is that the port allocation occur in
->ndo_init().

Your fix, while solving some cases, does not fully cover all of the
posibiities due to this bug.

Please fix this correctly by moving the port allocation and related
setup from link creation to ->ndo_init().

Thank you.

  parent reply	other threads:[~2017-11-03  5:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 16:39 [PATCH net 0/2] NULL pointer dereference in {ipvlan|macvlan}_port_destroy Girish Moodalbail
2017-10-31 16:39 ` [PATCH net 1/2] ipvlan: NULL pointer dereference panic in ipvlan_port_destroy Girish Moodalbail
2017-10-31 16:39 ` [PATCH net 2/2] macvlan: NULL pointer dereference panic in macvlan_port_destroy Girish Moodalbail
2017-11-03  5:05 ` David Miller [this message]
2017-11-03 16:39   ` [PATCH net 0/2] NULL pointer dereference in {ipvlan|macvlan}_port_destroy Girish Moodalbail

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=20171103.140511.953424236476363454.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=girish.moodalbail@oracle.com \
    --cc=netdev@vger.kernel.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).