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, 28 Nov 2007 16:02:29 -0600
From:	"Jon Nelson" <jnelson@...poni.net>
To:	"Stephen Hemminger" <shemminger@...ux-foundation.org>
Cc:	"Jarek Poplawski" <jarkao2@...pl>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	jnelson-kernel-bugzilla@...poni.net,
	"Herbert Xu" <herbert@...dor.apana.org.au>
Subject: Re: [PATCH] via-velocity: don't oops on MTU change.

Just a reminder: the following fix should (IMO) be considered for
2.6.24. The first patch does indeed fix the OOPS on MTU however
subsequent MTU changes still OOPS. The below fixes that. I've been
using both patches for over a week and they work just great. I noticed
that the first fix made 2.6.24 but this one hadn't -  I just want to
try to make sure 2.6.24 doesn't make things /worse/ for via-velocity
owners instead of better.

Stephen Hemminger <shemminger@...ux-foundation.org> wrote:
> Does this fix the problem.
>
> Note: reading the code the driver has other problems (besides crappy
> style). It does pci_map_single()/unmap in a way that doesn't account
> correctly for the padding that was added.
>
> --- a/drivers/net/via-velocity.c        2007-11-15 20:11:12.000000000 -0800
> +++ b/drivers/net/via-velocity.c        2007-11-15 20:32:14.000000000 -0800
> @@ -1242,6 +1242,9 @@ static int velocity_rx_refill(struct vel
>  static int velocity_init_rd_ring(struct velocity_info *vptr)
>  {
>         int ret;
> +       int mtu = vptr->dev->mtu;
> +
> +       vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32;
>
>         vptr->rd_info = kcalloc(vptr->options.numrx,
>                                 sizeof(struct velocity_rd_info), GFP_KERNEL);
> @@ -1898,8 +1901,6 @@ static int velocity_open(struct net_devi
>         struct velocity_info *vptr = netdev_priv(dev);
>         int ret;
>
> -       vptr->rx_buf_sz = (dev->mtu <= 1504 ? PKT_BUF_SZ : dev->mtu + 32);
> -
>         ret = velocity_init_rings(vptr);
>         if (ret < 0)
>                 goto out;
> @@ -1978,12 +1979,6 @@ static int velocity_change_mtu(struct ne
>                 velocity_free_rd_ring(vptr);
>
>                 dev->mtu = new_mtu;
> -               if (new_mtu > 8192)
> -                       vptr->rx_buf_sz = 9 * 1024;
> -               else if (new_mtu > 4096)
> -                       vptr->rx_buf_sz = 8192;
> -               else
> -                       vptr->rx_buf_sz = 4 * 1024;
>
>                 ret = velocity_init_rd_ring(vptr);
>                 if (ret < 0)

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