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]
Date:	Wed, 17 Sep 2014 16:51:53 -0400
From:	Vlad Yasevich <vyasevich@...il.com>
To:	Cong Wang <cwang@...pensource.com>
CC:	Florian Westphal <fw@...len.de>,
	Francesco Ruggeri <fruggeri@...sta.com>,
	netdev <netdev@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Weilong Chen <chenweilong@...wei.com>
Subject: Re: Cannot move macvlan interface on top of bonding device

On 09/17/2014 04:46 PM, Cong Wang wrote:
> On Wed, Sep 17, 2014 at 1:39 PM, Vlad Yasevich <vyasevich@...il.com> wrote:
>> On 09/17/2014 03:06 PM, Florian Westphal wrote:
>>> Cong Wang <cwang@...pensource.com> wrote:
>>>> On Wed, Sep 17, 2014 at 8:56 AM, Francesco Ruggeri <fruggeri@...sta.com> wrote:
>>>>> This used to work in older releases.
>>>>> The problem seems to be that commit f939981492 sets NETIF_F_NETNS_LOCAL
>>>>> on bonding interfaces, and commit 797f87f83 causes macvlan interfaces
>>>>> to inherit its features from the lower device.
>>>>>
>>>>> Is there a reason why NETIF_F_NETNS_LOCAL should be inherited from the
>>>>> lower device
>>>>> by macvlan interfaces?
>>>>
>>>> commit 797f87f83 looks wrong, it should not inherit NETIF_F_NETNS_LOCAL,
>>>> so just clear this flag. Please submit a patch.
>>>
>>> Under which conditions would NETIF_F_NETNS_LOCAL have to be inherited?
>>> (i.e., why is it inheritable in the first place?)
>>
>> macvlan code calls
>>         features = netdev_increment_features(vlan->lowerdev->features,
>>                                              features,
>>                                              mask);
>>
>> where lowerdev->features contains the NETIF_F_NETNS_LOCAL bit.  That
>> bit is not set in features or in mask.  It is also not one of the ALL_FOR_ALL
>> bits so it's not turned off.
>>
>> As an example, here are the values from a quit test I ran:
>>
>> bond features = 0x400f3888
>> features = 0x3b5a09  (mask is the same).
>> incremented features = 0x41bf389
>>
>> NETIF_F_NETNS_LOCAL is still on.
> 

No, it is not.  NETIF_F_NETNS_LOCAL is bit 13 and that's off.  Bits
14 (GRO) and 12 (LLTX) are set.

-vlad

> I think the comment on netdev_increment_features() is clear:
> 
>  *      Computes a new feature set after adding a device with feature set
>  *      @one to the master device with current feature set @all.  Will not
>  *      enable anything that is off in @mask. Returns the new feature set.
> 
> And NETIF_F_NETNS_LOCAL is on in mask.
> 
>>
>> May be a better solution is:
>>
>>         features = netdev_increment_features(vlan->lowerdev->features & MACVLAN_FEATURS,
>>                                              features,
>>                                              mask);
>>
>> This way we start with only the feature MACVLAN is interested in.
>>
> 
> Or clear it in mask?
> 

--
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