netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
To: Mahesh Bandewar <maheshb@google.com>, netdev <netdev@vger.kernel.org>
Cc: Eric Dumazet <edumazet@google.com>,
	Maciej Zenczykowski <maze@google.com>,
	Laurent Chavey <chavey@google.com>,
	Tim Hockin <thockin@google.com>,
	David Miller <davem@davemloft.net>,
	Brandon Philips <brandon.philips@coreos.com>,
	Pavel Emelianov <xemul@parallels.com>
Subject: Re: [PATCH net-next v4] ipvlan: Initial check-in of the IPVLAN driver.
Date: Wed, 26 Nov 2014 15:41:53 +0900	[thread overview]
Message-ID: <54757631.8090604@lab.ntt.co.jp> (raw)
In-Reply-To: <1416812866-13401-1-git-send-email-maheshb@google.com>

Hi Mahesh,

I found that deleting the last ipvlan device triggers WARN_ON() in
rtmsg_ifinfo().
ipvlan_nl_fillinfo() seems to return -EINVAL in that case.

> +static int ipvlan_nl_fillinfo(struct sk_buff *skb,
> +			      const struct net_device *dev)
> +{
> +	struct ipvl_dev *ipvlan = netdev_priv(dev);
> +	struct ipvl_port *port = ipvlan_port_get_rtnl(ipvlan->phy_dev);
> +	int ret = -EINVAL;
> +
> +	if (!port)
> +		goto err;
> +
> +	ret = -EMSGSIZE;
> +	if (nla_put_u16(skb, IFLA_IPVLAN_MODE, port->mode))
> +		goto err;
> +
> +	return 0;
> +
> +err:
> +	return ret;
> +}

rollback_registered_many() calls rtmsg_ifinfo() after calling ndo_uninit().
ndo_uninit() (ipvlan_uninit() -> ipvlan_port_destroy() ->
netdev_rx_handler_unregister()) sets rx_handler_data into NULL.
So, we cannot dereference "port" in ipvlan_nl_fillinfo().

Maybe "mode" should belong to struct ipvl_dev?

Thanks,
Toshiaki Makita

  parent reply	other threads:[~2014-11-26  6:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24  7:07 [PATCH net-next v4] ipvlan: Initial check-in of the IPVLAN driver Mahesh Bandewar
2014-11-24 20:29 ` David Miller
2014-11-26  6:41 ` Toshiaki Makita [this message]
2014-11-26 17:05   ` Mahesh Bandewar
2014-11-27  1:59     ` Toshiaki Makita
2014-11-27  6:55       ` Mahesh Bandewar

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=54757631.8090604@lab.ntt.co.jp \
    --to=makita.toshiaki@lab.ntt.co.jp \
    --cc=brandon.philips@coreos.com \
    --cc=chavey@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=maheshb@google.com \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=thockin@google.com \
    --cc=xemul@parallels.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).