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:   Thu, 17 Feb 2022 14:44:13 +0800
From:   "Ziyang Xuan (William)" <william.xuanziyang@...wei.com>
To:     <netdev@...r.kernel.org>
CC:     <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
        <pablo@...filter.org>, <keescook@...omium.org>, <alobakin@...me>,
        <nbd@....name>, <herbert@...dor.apana.org.au>
Subject: Re: Why vlan_dev can not follow real_dev mtu change from smaller to
 bigger

> Hello,
> 
> Recently, I did some tests about mtu change for vlan device
> and real_dev. I found that vlan_dev's mtu could not follow its
> real_dev's mtu change from smaller to bigger.
> 
> For example:
> Firstly, change real_dev's mtu from 1500 to 256, vlan_dev's mtu
> follow change from 1500 to 256.
> Secondly, change real_dev's mtu from 256 to 1500, but vlan_dev's
> mtu is still 256.
> 
> I fond the code as following. But I could not understand the
> limitations. Is there anyone can help me?
> 
> static int vlan_device_event(struct notifier_block *unused, unsigned long event,
> 			     void *ptr)
> {
> 	...
> 
> 	case NETDEV_CHANGEMTU:
> 		vlan_group_for_each_dev(grp, i, vlandev) {
> 			if (vlandev->mtu <= dev->mtu)
> 				continue;
> 
> 			dev_set_mtu(vlandev, dev->mtu);
> 		}
> 		break;
> 	...
> }
> 
> Thank you for your reply.
> 
commit: 2e477c9bd2bb ("vlan: Propagate physical MTU changes") wanted
to ensure that all existing VLAN device MTUs do not exceed the new
underlying MTU. Make VLAN device MTUs equal to the new underlying MTU
follow this rule. So I think the following modification is reasonable
and can solve the above problem.

@@ -418,12 +418,8 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
                break;

        case NETDEV_CHANGEMTU:
-               vlan_group_for_each_dev(grp, i, vlandev) {
-                       if (vlandev->mtu <= dev->mtu)
-                               continue;
-
+               vlan_group_for_each_dev(grp, i, vlandev)
                        dev_set_mtu(vlandev, dev->mtu);
-               }
                break;

Are there any other different operations?

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ