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: <CANn89i+3kwiF0NESY7ReK=ZrNbhc7-q7QU2sZhsR9gtwVje2jA@mail.gmail.com>
Date: Thu, 5 Sep 2024 16:59:47 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Sean Anderson <sean.anderson@...ux.dev>
Cc: Radhey Shyam Pandey <radhey.shyam.pandey@....com>, "David S . Miller" <davem@...emloft.net>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org, 
	Michal Simek <michal.simek@....com>, linux-arm-kernel@...ts.infradead.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] net: xilinx: axienet: Relax partial rx checksum checks

On Thu, Sep 5, 2024 at 4:24 PM Sean Anderson <sean.anderson@...ux.dev> wrote:
>
> On 9/4/24 12:30, Eric Dumazet wrote:
> > On Tue, Sep 3, 2024 at 8:43 PM Sean Anderson <sean.anderson@...ux.dev> wrote:
> >>
> >> The partial rx checksum feature computes a checksum over the entire
> >> packet, regardless of the L3 protocol. Remove the check for IPv4.
> >> Additionally, packets under 64 bytes should have been dropped by the
> >> MAC, so we can remove the length check as well.
> >
> > Some packets have a smaller len (than 64).
> >
> > For instance, TCP pure ACK and no options over IPv4 would be 54 bytes long.
> >
> > Presumably they are not dropped by the MAC ?
>
> Ethernet frames have a minimum size on the wire of 64 bytes. From 802.3
> section 4.2.4.2.2:
>
> | The shortest valid transmission in full duplex mode must be at least
> | minFrameSize in length. While collisions do not occur in full duplex
> | mode MACs, a full duplex MAC nevertheless discards received frames
> | containing less than minFrameSize bits. The discarding of such a frame
> | by a MAC is not reported as an error.
>
> where minFrameSize is 512 bits (64 bytes).
>
> On the transmit side, undersize frames are padded. From 802.3 section
> 4.2.3.3:
>
> | The CSMA/CD Media Access mechanism requires that a minimum frame
> | length of minFrameSize bits be transmitted. If frameSize is less than
> | minFrameSize, then the CSMA/CD MAC sublayer shall append extra bits in
> | units of octets (Pad), after the end of the MAC Client Data field but
> | prior to calculating and appending the FCS (if not provided by the MAC
> | client).
>
> That said, I could not find any mention of a minimum frame size
> limitation for partial checksums in the AXI Ethernet documentation.
> RX_CSRAW is calculated over the whole packet, so it's possible that this
> check is trying to avoid passing it to the net subsystem when the frame
> has been padded. However, skb->len is the length of the Ethernet packet,
> so we can't tell how long the original packet was at this point. That
> can only be determined from the L3 header, which isn't parsed yet. I
> assume this is handled by the net subsystem.
>

The fact there was a check in the driver hints about something.

It is possible the csum is incorrect if a 'padding' is added at the
receiver, if the padding has non zero bytes, and is not included in
the csum.

Look at this relevant patch :

Author: Saeed Mahameed <saeedm@...lanox.com>
Date:   Mon Feb 11 18:04:17 2019 +0200

    net/mlx4_en: Force CHECKSUM_NONE for short ethernet frames

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ