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:	Wed, 07 Feb 2007 15:05:39 -0600
From:	Dave Kleikamp <shaggy@...ux.vnet.ibm.com>
To:	Andreas Dilger <adilger@...sterfs.com>
Cc:	Johann Lombardi <johann.lombardi@...l.net>,
	Kalpak Shah <kalpak@...sterfs.com>,
	linux-ext4 <linux-ext4@...r.kernel.org>, tytso <tytso@....edu>,
	sct <sct@...hat.com>
Subject: Re: [RFC] [PATCH 1/1] Nanosecond timestamps

On Wed, 2007-02-07 at 13:39 -0700, Andreas Dilger wrote:
> On Feb 06, 2007  16:12 +0100, Johann Lombardi wrote:
> > > +                       if (EXT3_SB(sb)->s_want_extra_isize <
> > > +                           le32_to_cpu(es->s_min_extra_isize))
> >                                 ^^
> > > +                               EXT3_SB(sb)->s_want_extra_isize =
> > > +                                       le32_to_cpu(es->s_min_extra_isize);
> >                                             ^^
> > Since es->s_{min,want}_extra_isize are both __u16 (BTW, shouldn't it be
> > __le16?), I think you should use le16_to_cpu() instead of le32_to_cpu().
> 
> You are right - this works fine on little endian systems, but fails on
> big endian systems where you will get the other half of the word.
> 
> This has been a bug in several places already, and I wonder if the
> le*_to_cpu() and cpu_to_le*() macros shouldn't do some type checking
> instead of just casting the variable to the specified type?

I think that sparse will catch this.  To get the endian checks you need
to do something like this:

make C=2 CF="-D__CHECK_ENDIAN__"'

-- 
David Kleikamp
IBM Linux Technology Center

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" 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