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: <d844c643-16bd-6f9d-1d39-a4f93b3fcf87@bootlin.com>
Date: Tue, 16 Jan 2024 17:18:30 +0100 (CET)
From: Romain Gantois <romain.gantois@...tlin.com>
To: Jakub Kicinski <kuba@...nel.org>
cc: Romain Gantois <romain.gantois@...tlin.com>, 
    Alexandre Torgue <alexandre.torgue@...s.st.com>, 
    Jose Abreu <joabreu@...opsys.com>, "David S. Miller" <davem@...emloft.net>, 
    Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, 
    Maxime Coquelin <mcoquelin.stm32@...il.com>, 
    Miquel Raynal <miquel.raynal@...tlin.com>, 
    Maxime Chevallier <maxime.chevallier@...tlin.com>, 
    Sylvain Girard <sylvain.girard@...com>, 
    Pascal EBERHARD <pascal.eberhard@...com>, 
    Richard Tresidder <rtresidd@...ctromag.com.au>, 
    Linus Walleij <linus.walleij@...aro.org>, 
    Vladimir Oltean <olteanv@...il.com>, Andrew Lunn <andrew@...n.ch>, 
    Thomas Petazzoni <thomas.petazzoni@...tlin.com>, netdev@...r.kernel.org, 
    linux-stm32@...md-mailman.stormreply.com, 
    linux-arm-kernel@...ts.infradead.org, stable@...r.kernel.org, 
    Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [PATCH net v5] net: stmmac: Prevent DSA tags from breaking COE

On Tue, 16 Jan 2024, Jakub Kicinski wrote:

> Hm, the comment in enh_desc_coe_rdes0() says:
> 
> 	/* bits 5 7 0 | Frame status
> 	 * ----------------------------------------------------------
> 	 *      0 0 0 | IEEE 802.3 Type frame (length < 1536 octects)
> 	 *      1 0 0 | IPv4/6 No CSUM errorS.
> 	 *      1 0 1 | IPv4/6 CSUM PAYLOAD error
> 	 *      1 1 0 | IPv4/6 CSUM IP HR error
> 	 *      1 1 1 | IPv4/6 IP PAYLOAD AND HEADER errorS
> 	 *      0 0 1 | IPv4/6 unsupported IP PAYLOAD
> 	 *      0 1 1 | COE bypassed.. no IPv4/6 frame
> 	 *      0 1 0 | Reserved.
> 	 */
> 
> which makes it sound like bit 5 will not be set for a Ethernet II frame
> with unsupported IP payload, or not an IP frame. Does the bit mean other
> things in different descriptor formats?

The description of this bit in my datasheet is:

```
b5 FT Frame Type
When set, this bit indicates that the Receive Frame is an Ethernet-type frame 
(the Length/Type field is greater than or equal to 1,536). When this bit is 
reset, it indicates that the received frame is an IEEE 802.3 frame. This bit is 
not valid for Runt frames less than 14 bytes
```

There is no mention of a more subtle check to detect non-IP Ethernet II frames. 
I ran some tests on my hardware and EDSA-tagged packets consistently come in 
with status 0b100, so the MAC sets the frame type bit even for frames that don't 
have an IP ethertype.

Best Regards,

-- 
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ