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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BLUPR03MB141289B9E24503DF35D5AAC3CAD20@BLUPR03MB1412.namprd03.prod.outlook.com>
Date:   Wed, 19 Oct 2016 14:07:47 +0000
From:   Haiyang Zhang <haiyangz@...rosoft.com>
To:     Jarod Wilson <jarod@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>,
        KY Srinivasan <kys@...rosoft.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Shrikrishna Khare <skhare@...are.com>,
        "VMware, Inc." <pv-drivers@...are.com>
Subject: RE: [PATCH net-next 5/6] net: use core MTU range checking in virt
 drivers



> -----Original Message-----
> From: Jarod Wilson [mailto:jarod@...hat.com]
> Sent: Tuesday, October 18, 2016 10:34 PM
> To: linux-kernel@...r.kernel.org
> Cc: Jarod Wilson <jarod@...hat.com>; netdev@...r.kernel.org;
> virtualization@...ts.linux-foundation.org; KY Srinivasan
> <kys@...rosoft.com>; Haiyang Zhang <haiyangz@...rosoft.com>; Michael S.
> Tsirkin <mst@...hat.com>; Shrikrishna Khare <skhare@...are.com>; VMware,
> Inc. <pv-drivers@...are.com>
> Subject: [PATCH net-next 5/6] net: use core MTU range checking in virt
> drivers
> 
> hyperv_net:
> - set min/max_mtu
> 
> virtio_net:
> - set min/max_mtu
> - remove virtnet_change_mtu
> 
> vmxnet3:
> - set min/max_mtu
> 
> CC: netdev@...r.kernel.org
> CC: virtualization@...ts.linux-foundation.org
> CC: "K. Y. Srinivasan" <kys@...rosoft.com>
> CC: Haiyang Zhang <haiyangz@...rosoft.com>
> CC: "Michael S. Tsirkin" <mst@...hat.com>
> CC: Shrikrishna Khare <skhare@...are.com>
> CC: "VMware, Inc." <pv-drivers@...are.com>
> Signed-off-by: Jarod Wilson <jarod@...hat.com>
> ---
>  drivers/net/hyperv/hyperv_net.h   |  4 ++--
>  drivers/net/hyperv/netvsc_drv.c   | 14 +++++++-------
>  drivers/net/virtio_net.c          | 23 ++++++++++-------------
>  drivers/net/vmxnet3/vmxnet3_drv.c |  7 ++++---
>  4 files changed, 23 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/hyperv/hyperv_net.h
> b/drivers/net/hyperv/hyperv_net.h
> index f4fbcb5..3958ada 100644
> --- a/drivers/net/hyperv/hyperv_net.h
> +++ b/drivers/net/hyperv/hyperv_net.h
> @@ -606,8 +606,8 @@ struct nvsp_message {
>  } __packed;
> 
> 
> -#define NETVSC_MTU 65536
> -#define NETVSC_MTU_MIN 68
> +#define NETVSC_MTU 65535

Why change it to 65535? For Hyperv host, this should be 65536.


> @@ -1343,6 +1336,13 @@ static int netvsc_probe(struct hv_device *dev,
> 
>  	netif_carrier_off(net);
> 
> +	/* MTU range: 68 - 1500 or 65521 */
> +	net->min_mtu = NETVSC_MTU_MIN;
> +	if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2)
> +		net->max_mtu = NETVSC_MTU - ETH_HLEN;
> +	else
> +		net->max_mtu = ETH_DATA_LEN;
> +
>  	netvsc_init_settings(net);
> 
>  	net_device_ctx = netdev_priv(net);

nvdev->nvsp_version is not set until after rndis_filter_device_add()
is successfully completed.
You need to move this part to the place just before this line:
 ret = register_netdev(net);

Thanks,
- Haiyang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ