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:   Thu, 12 Oct 2023 14:55:04 +0200
From:   Alexander Potapenko <glider@...gle.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     catalin.marinas@....com, will@...nel.org, pcc@...gle.com,
        andreyknvl@...il.com, aleksander.lobakin@...el.com,
        linux@...musvillemoes.dk, yury.norov@...il.com,
        alexandru.elisei@....com, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, eugenis@...gle.com,
        syednwaris@...il.com, william.gray@...aro.org,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v7 1/5] lib/bitmap: add bitmap_{read,write}()

>
> I realized that the corner case with these functions is when agnostic user
> wants to read / write > 32 bits at a time without ifdeffery applied.

Shall we change

        if (unlikely(!nbits))
                return;

to

        if (unlikely(!nbits || nbits > BITS_PER_LONG))
                return;

?

> At bare minimum this has to be documented explicitly, that callers
> may have an issue of the above calls on 32-bit platforms.

Given that bitmap_read() returns an unsigned long, and bitmap_write()
writes an unsigned long, passing a 64-bit value would be a bug.
But you are right, documenting this won't hurt.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ