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: <CANn89iKMS2cvgca7qOrVMhWQOoJMuZ-tJ99WTtkXng1O69rOdQ@mail.gmail.com>
Date: Tue, 2 Apr 2024 17:50:31 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: shironeko@...aguri.club, Jose Alonso <joalonsof@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org, 
	Soheil Hassas Yeganeh <soheil@...gle.com>, Neal Cardwell <ncardwell@...gle.com>, 
	Yuchung Cheng <ycheng@...gle.com>, eric.dumazet@...il.com
Subject: Re: [PATCH net-next] tcp: get rid of sysctl_tcp_adv_win_scale

On Tue, Apr 2, 2024 at 5:28 PM <shironeko@...aguri.club> wrote:
>
> Hi all,
>
> These parts seems to be causing a regression for a specific USB NIC, I
> have this on one of home server, and it's network will randomly cut out
> a few times a week.
> Seems others have ran into the same issue with this particular NIC as
> well https://bugzilla.kernel.org/show_bug.cgi?id=218536
>
> > +/* inverse of tcp_win_from_space() */
> > +static inline int tcp_space_from_win(const struct sock *sk, int win)
> > +{
> > +     u64 val = (u64)win << TCP_RMEM_TO_WIN_SCALE;
> > +
> > +     do_div(val, tcp_sk(sk)->scaling_ratio);
> > +     return val;
> > +}
> > +
> > +static inline void tcp_scaling_ratio_init(struct sock *sk)
> > +{
> > +     /* Assume a conservative default of 1200 bytes of payload per 4K
> > page.
> > +      * This may be adjusted later in tcp_measure_rcv_mss().
> > +      */
> > +     tcp_sk(sk)->scaling_ratio = (1200 << TCP_RMEM_TO_WIN_SCALE) /
> > +                                 SKB_TRUESIZE(4096);
> >  }
> ...
> > @@ -740,12 +750,7 @@ void tcp_rcv_space_adjust(struct sock *sk)
> >               do_div(grow, tp->rcvq_space.space);
> >               rcvwin += (grow << 1);
> >
> > -             rcvmem = SKB_TRUESIZE(tp->advmss + MAX_TCP_HEADER);
> > -             while (tcp_win_from_space(sk, rcvmem) < tp->advmss)
> > -                     rcvmem += 128;
> > -
> > -             do_div(rcvwin, tp->advmss);
> > -             rcvbuf = min_t(u64, rcvwin * rcvmem,
> > +             rcvbuf = min_t(u64, tcp_space_from_win(sk, rcvwin),
> >                              READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]));
> >               if (rcvbuf > sk->sk_rcvbuf) {
> >                       WRITE_ONCE(sk->sk_rcvbuf, rcvbuf);
>
> The NIC:
> usb 2-2: new SuperSpeed USB device number 4 using xhci_hcd
> usb 2-2: New USB device found, idVendor=0b95, idProduct=1790, bcdDevice=
> 1.00
> usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 2-2: Product: AX88179
> usb 2-2: Manufacturer: ASIX Elec. Corp.
> usb 2-2: SerialNumber: 0000000000009D
> ax88179_178a 2-2:1.0 eth0: register 'ax88179_178a' at
> usb-0000:00:14.0-2, ASIX AX88179 USB 3.0 Gigabit Ethernet,
> 02:5e:c0:4b:a4:f7
> ax88179_178a 2-2:1.0 eth0: ax88179 - Link status is: 1
>
> The dmesg error I get:
>

Thanks for the report. This driver is probably lying on skb->truesize.

This commit looks suspicious

commit f8ebb3ac881b17712e1d5967c97ab1806b16d3d6
Author: Jose Alonso <joalonsof@...il.com>
Date:   Tue Jun 28 12:13:02 2022 -0300

    net: usb: ax88179_178a: Fix packet receiving

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ