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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 22 May 2014 10:29:20 +0200
From:	Steffen Klassert <steffen.klassert@...unet.com>
To:	Cong Wang <cwang@...pensource.com>
CC:	Jet Chen <jet.chen@...el.com>, netdev <netdev@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Fengguang Wu <fengguang.wu@...el.com>
Subject: Re: [net] WARNING: CPU: 1 PID: 1 at
 net/batman-adv/hard-interface.c:92 batadv_is_on_batman_iface()

On Wed, May 21, 2014 at 11:12:36PM -0700, Cong Wang wrote:
> 
> batman needs to fix:
> 
> diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
> index b851cc5..fbda6b5 100644
> --- a/net/batman-adv/hard-interface.c
> +++ b/net/batman-adv/hard-interface.c
> @@ -83,7 +83,7 @@ static bool batadv_is_on_batman_iface(const struct
> net_device *net_dev)
>                 return true;
> 
>         /* no more parents..stop recursion */
> -       if (net_dev->iflink == net_dev->ifindex)
> +       if (net_dev->iflink == 0 || net_dev->iflink == net_dev->ifindex)
>                 return false;
> 
>         /* recurse over the parent device */

Right, I think this is the correct fix.
Please do a proper patch submission for this.

I wondered why this issue does not show up with ipv6 tunnels
and it appears to be a bug :)

When a ipv6 tunnel interface is created, ip6_tnl_create2()
calls ip6_tnl_dev_init() which calls ip6_tnl_link_config().
ip6_tnl_link_config() sets dev->iflink.

Then register_netdev() overwrites this setting with
dev->iflink = dev->ifindex.

The output of the 'ip a' command looks like this:


9: ip6tnl0: <NOARP> mtu 1452 qdisc noop state DOWN                              
    link/tunnel6 :: brd ::
11: ip6tunnel1: <POINTOPOINT,NOARP> mtu 1452 qdisc noop state DOWN              
    link/tunnel6 2001:470:1f00:ffff::191 peer 2001:470:1f00:ffff::189


When I change to avoid the overwriting of dev->iflink it looks
like this:

9: ip6tnl0@...E: <NOARP> mtu 1452 qdisc noop state DOWN                         
    link/tunnel6 :: brd :: 
12: ip6tunnel1@...0: <POINTOPOINT,NOARP> mtu 1452 qdisc noop state DOWN         
    link/tunnel6 2001:470:1f00:ffff::191 peer 2001:470:1f00:ffff::189

So I think dev->iflink should be set in the ndo_init() function
of the tunnel, then register_netdev() leaves dev->iflink alone.

Thoughts, comments?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists