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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 13 Jan 2021 20:11:03 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     David Wu <david.wu@...k-chips.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, joabreu@...opsys.com,
        alexandre.torgue@...com, peppe.cavallaro@...com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: stmmac: Fixed mtu channged by cache aligned

On Wed, 13 Jan 2021 11:41:09 +0800 David Wu wrote:
> Since the original mtu is not used when the mtu is updated,
> the mtu is aligned with cache, this will get an incorrect.
> For example, if you want to configure the mtu to be 1500,
> but mtu 1536 is configured in fact.
> 
> Fixed: eaf4fac478077 ("net: stmmac: Do not accept invalid MTU values")
> Signed-off-by: David Wu <david.wu@...k-chips.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 5b1c12ff98c0..e8640123db76 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -4025,7 +4025,7 @@ static void stmmac_set_rx_mode(struct net_device *dev)
>  static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
>  {
>  	struct stmmac_priv *priv = netdev_priv(dev);
> -	int txfifosz = priv->plat->tx_fifo_size;
> +	int txfifosz = priv->plat->tx_fifo_size, mtu = new_mtu;

Adjusted the code a little here to keep the variable declaration lines
ordered longest to shortest, and applied. 

Thanks!

Powered by blists - more mailing lists