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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 28 Dec 2020 12:10:46 -0800
From:   Yury Norov <yury.norov@...il.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Carsten Haitzler <carsten.haitzler@....com>,
        Liviu Dudau <liviu.dudau@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Rasmus Villemoes <rasmus.villemoes@...vas.dk>
Subject: Re: [PATCH] drm/komeda: use bitmap API to convert U32 to bitmap

On Mon, Dec 28, 2020 at 11:49 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Mon, Dec 28, 2020 at 11:43:43AM -0800, Yury Norov wrote:
> > The commit be3e477effba636ad25 ("drm/komeda: Fix bit
> > check to import to value of proper type") fixes possible
> > out-of-bound issue related to find_first_bit() usage, but
> > does not address the endianness problem.
>
> Hmm... Can you elaborate?
>
> ...
>
> >                                   u32 comp_mask)
>
> > -     unsigned long comp_mask_local = (unsigned long)comp_mask;
>
> Here we convert u32 to unsigned long (LSB is kept LSB since it happens in
> native endianess).
>
> > -     id = find_first_bit(&comp_mask_local, 32);
>
> Here it takes an address to unsigned long and tries only lower 32 bits.
>
> Are you telling that find_first_bit() has an issue?

It seems you're right, there's no issue with endianness in existing code.
In fact, the line

> > -     unsigned long comp_mask_local = (unsigned long)comp_mask;

is an opencoded version of bitmap_from_arr32(dst, src, 32).

Maybe it would be better to use the bitmap API here, but existing code is
correct. Sorry for the noise.

Yury

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ