lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5476859E.609@lab.ntt.co.jp>
Date:	Thu, 27 Nov 2014 10:59:58 +0900
From:	Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
To:	Mahesh Bandewar <maheshb@...gle.com>
CC:	netdev <netdev@...r.kernel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	Maciej Zenczykowski <maze@...gle.com>,
	Laurent Chavey <chavey@...gle.com>,
	Tim Hockin <thockin@...gle.com>,
	David Miller <davem@...emloft.net>,
	Brandon Philips <brandon.philips@...eos.com>,
	Pavel Emelianov <xemul@...allels.com>
Subject: Re: [PATCH net-next v4] ipvlan: Initial check-in of the IPVLAN driver.

On 2014/11/27 2:05, Mahesh Bandewar wrote:
> On Tue, Nov 25, 2014 at 10:41 PM, Toshiaki Makita
> <makita.toshiaki@....ntt.co.jp> wrote:
>> 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().
>>
> Calling fillinfo() after calling uninit() seems pointless on any
> device. 

bonding needs calling rtmsg_ifinfo() after calling ndo_uninit().
56bfa7ee7c88 ("unregister_netdevice : move RTM_DELLINK to until after
ndo_uninit")

> But how are you hitting this case? Can you share the command
> sequence with me?

# ip link add link eth0 name ipvl0 type ipvlan
# ip link del ipvl0

Thanks,
Toshiaki Makita

> 
> Thanks,
> --mahesh..
> 
>> Maybe "mode" should belong to struct ipvl_dev?
>>
>> Thanks,
>> Toshiaki Makita

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ