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: <20071022104208.78c79467@poseidon.drzeus.cx>
Date:	Mon, 22 Oct 2007 10:42:08 +0200
From:	Pierre Ossman <drzeus@...eus.cx>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org
Subject: Re: net: alignment problem in icmp code

On Mon, 22 Oct 2007 01:31:05 -0700 (PDT)
David Miller <davem@...emloft.net> wrote:

> 
> On fast paths we aren't going to add things like get_unaligned()
> calls.
> 
> Every architecture should handle unaligned accesses properly, and for
> the fast paths the network driver should provide the packet fully
> aligned or take steps to make it so if it can't DMA directly into
> 2-byte offset buffers (such as copying the packet).
> 

This seems like a rather evil layering violation. The hardware driver needs to be aware of every layer between itself and the IP stack for this to work. And what does "aligned" mean in this context? 32-bit aligned? 64-bit aligned? The entire thing is severely underdocumented (which is why I got hit by the problem in the first place).

Also, since I developed the code on a forgiving platform (x86), I didn't notice this requirement. Perhaps a WARN_ON(NET_IP_ALIGN && (skb->data & 0x3));?

> What is the specific reason why you see packet headers unaligned?
> It's probably just some AVR networking driver that needs tweaks.

It's my own driver (if_sdio for libertas), which did not reserve two bytes as that voodoo was unknown to me.

Rgds
Pierre

Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ