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: <20200626115704.1439eff4@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Fri, 26 Jun 2020 11:57:04 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc:     davem@...emloft.net, Alice Michael <alice.michael@...el.com>,
        netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
        Alan Brady <alan.brady@...el.com>,
        Phani Burra <phani.r.burra@...el.com>,
        Joshua Hay <joshua.a.hay@...el.com>,
        Madhu Chittim <madhu.chittim@...el.com>,
        Pavan Kumar Linga <pavan.kumar.linga@...el.com>,
        Donald Skidmore <donald.c.skidmore@...el.com>,
        Jesse Brandeburg <jesse.brandeburg@...el.com>,
        Sridhar Samudrala <sridhar.samudrala@...el.com>
Subject: Re: [net-next v3 13/15] iecm: Add ethtool

On Thu, 25 Jun 2020 19:07:35 -0700 Jeff Kirsher wrote:
> @@ -978,7 +1059,20 @@ static int iecm_open(struct net_device *netdev)
>   */
>  static int iecm_change_mtu(struct net_device *netdev, int new_mtu)
>  {
> -	/* stub */
> +	struct iecm_vport *vport =  iecm_netdev_to_vport(netdev);
> +
> +	if (new_mtu < netdev->min_mtu) {
> +		netdev_err(netdev, "new MTU invalid. min_mtu is %d\n",
> +			   netdev->min_mtu);
> +		return -EINVAL;
> +	} else if (new_mtu > netdev->max_mtu) {
> +		netdev_err(netdev, "new MTU invalid. max_mtu is %d\n",
> +			   netdev->max_mtu);
> +		return -EINVAL;
> +	}

Core already checks this. Please remove all checks which core already
does.

> +	netdev->mtu = new_mtu;
> +
> +	return iecm_initiate_soft_reset(vport, __IECM_SR_MTU_CHANGE);
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ