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]
Date:	Mon, 05 Nov 2007 18:12:46 +0200
From:	Radu Rendec <radu.rendec@...s.ro>
To:	Jarek Poplawski <jarkao2@...pl>
Cc:	jamal <hadi@...erus.ca>, netdev@...r.kernel.org
Subject: Re: Endianness problem with u32 classifier hash masks

On Mon, 2007-11-05 at 15:49 +0100, Jarek Poplawski wrote:
> > Yes, that example i believe would work just fine today as is with no
> > changes.
> ...
> > Please try the patch i sent since it is simpler. It is your work more or
> > less - so you should get the credit as author. 
> 
> Jamal + Houston, we have a problem...
> ...Or talk about different things or patches...
> 
> IMHO, both 'today as is' and your 1-st proposal get this example
> wrong: we need 00.00.00.ff at the end, don't we? 
> 
> Jarek P.

"Today as is" certainly doesn't work with masks extending across byte
boundary. I think Jarek's example (with all "1" bits in nibbles) is the
most straightforward to illustrate this.

Jarek, after I had replied you earlier, I figured out it can indeed be
solved with two shifts, but results need to be masked separately and
then merged to properly align resulting bits. Of course, this is my idea
about the two shifts, maybe you thought of something else.

On the other hand, after a quick browsing through a lxr, it seems that
(at least on i386) ntohl() is actually a swab32(), which is defined in
include/asm-i386/byteorder.h on line 13. In the worst scenario (with
CONFIG_X86_BSWAP being undefined) it's done in 3 instructions (asm
level). It may actually be faster than the two shift approach in C.

Jamal, sometime later in the evening I'll try the patch you sent,
although my guess is that it won't work (most probably it will produce
what Jarek suggested earlier). What exactly did you mean by "cutdown on
the conversion in u32_change()"?

Cheers,
Radu Rendec


-
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