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: <20080513083101.96c92bd6.akpm@linux-foundation.org>
Date:	Tue, 13 May 2008 08:31:01 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Nickolay Vinogradov <nickolay@...tei.ru>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] asm-generic/bitops/fls64.h

On Tue, 13 May 2008 14:43:43 +0400 Nickolay Vinogradov <nickolay@...tei.ru> wrote:

> Andrew Morton __________:
> > On Sun, 04 May 2008 22:58:50 +0400
> > ____________________ ______________ ____________________ <nickolay@...tei.ru> wrote:
> > 
> >> bugfix in fls64 on a big endian systems(against 2.6.25).
> >>
> >> Signed-off-by: Nickolay Vinogradov <nickolay@...tei.ru>
> >>
> >> --
> >>
> >> diff --git a/include/asm-generic/bitops/fls64.h 
> >> b/include/asm-generic/bitops/fls64.h
> >> index 1b6b17c..2eedb6f 100644
> >> --- a/include/asm-generic/bitops/fls64.h
> >> +++ b/include/asm-generic/bitops/fls64.h
> >> @@ -8,7 +8,7 @@ static inline int fls64(__u64 x)
> >>          __u32 h = x >> 32;
> >>          if (h)
> >>                  return fls(h) + 32;
> >> -       return fls(x);
> >> +       return fls((__u32)x);
> >>   }
> >>
> >>   #endif /* _ASM_GENERIC_BITOPS_FLS64_H_ */
> > 
> > Please describe the bug which you are fixing?
> > 
> > Perhaps a more robust fix to <whatever the bug is> would be to
> > repair fls() so that it works correctly when passed a u64.  Perhaps.
> 
> Repair fls64() so that it works correctly when passed a u64.
> 

Yes, but what's wrong with it now?

The fls() in include/asm-generic/bitops/fls.h takes an int.

The fls() in include/asm-x86/bitops.h takes an int.

So both of these will already trucate the incoming argument to 32-bits.

It seems that you are using a version of fls() which doesn't do this. 
Why?  Which architecture are you using?  Would it not be more robust to
fix fls()?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ