tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Patches fixing unaligned access in the networking code



n54%gmx.com@localhost (Kamil Rytarowski) writes:

>As mentioned in the logs [1], the address is misaligned.
>[1] http://netbsd.org/~kamil/patch-00115-tcp_input.2.txt

As I said, if the assumption is broken worse things will happen.

The most likely explanation is that, since x86 doesn't require alignment,
the code doesn't force align the data in the first place. The logged
addresses are all even, so that's probably a driver that ignores or
mishandles ETHER_ALIGN (ethernet header is 14 bytes).

And now please start arguing that unaligned accesses on x86 are
undefined behaviour and that compilers are allowed to break it.

Could you please also verify that my suggested change appeases
the sanitizer? It seems to ignore all the evil a few lines later...

-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index