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: <063D6719AE5E284EB5DD2968C1650D6D1CB24BB5@AcuExch.aculab.com>
Date:	Fri, 24 Apr 2015 09:03:42 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Sergei Shtylyov' <sergei.shtylyov@...entembedded.com>,
	David Miller <davem@...emloft.net>
CC:	"mitsuhiro.kimura.kc@...esas.com" <mitsuhiro.kimura.kc@...esas.com>,
	"f.fainelli@...il.com" <f.fainelli@...il.com>,
	"robh+dt@...nel.org" <robh+dt@...nel.org>,
	"pawel.moll@....com" <pawel.moll@....com>,
	"mark.rutland@....com" <mark.rutland@....com>,
	"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"galak@...eaurora.org" <galak@...eaurora.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"richardcochran@...il.com" <richardcochran@...il.com>,
	"linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>,
	"masaru.nagai.vx@...esas.com" <masaru.nagai.vx@...esas.com>
Subject: RE: [PATCH v3] Renesas Ethernet AVB driver

From: Sergei Shtylyov
> Sent: 22 April 2015 22:39
> On 04/22/2015 11:42 PM, David Miller wrote:
> 
> >>     Hmm, I've been digging in the net core, and was unable to see where TX
> >>     skb's get their NET_IP_ALIGN bytes reserved. Have I missed something?
> >>     Probably need to print out skb's fields...
> 
> > NET_IP_ALIGN is for receive, not transmit.
> 
>     But when I print 'skb->data' from the ndo_start_xmit() method (in the
> 'sh_eth' driver), all addresses end with 2, so it looks like NET_IP_ALIGN gets
> added somewhere...

For a locally generated message:
The TCP userdata is likely to be 4 byte aligned.
The TCP and IP headers are multiples of 4 bytes.
The MAC header is 14 bytes.
So you end up with a buffer that starts on a 4n+2 boundary or an initial
short fragment that is 4n+2 bytes long.

If a message is being forwarded the alignment probably depends on where
it came from.

If you have ethernet hardware that requires tx or rx buffers to be on
4n boundaries you should send it back as 'not fit for purpose'.

	David

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