[PATCH] arm: drop arch implementation for find_bit() functions

Guenter Roeck linux at roeck-us.net
Tue Jul 26 11:35:19 PDT 2022


On Tue, Jul 26, 2022 at 08:44:07AM -0700, Yury Norov wrote:
> find_next_bit(bitmap, nbits, off) shouldn't touch memory if
> nbits == 0 or off >= nbits to avoid out-of-boundary access.
> 
> Generic implementation has explicit check for this, but arm doesn't,
> which is spotted by KFENCE when running test_bitmap.
> 
...
> CC: Guenter Roeck <linux at roeck-us.net>
> CC: Dennis Zhou <dennis at kernel.org>
> CC: Russell King <linux at armlinux.org.uk>
> CC: Catalin Marinas <catalin.marinas at arm.com>
> CC: linux-arm-kernel at lists.infradead.org
> Reported-by: Guenter Roeck <linux at roeck-us.net>
> Suggested-by: Linus Torvalds <torvalds at linux-foundation.org>
> Signed-off-by: Yury Norov <yury.norov at gmail.com>

bitmap unit tests succeed, and the KFENCE report is no longer seen
even after 65 retries (previously it reproduced easily with 5-15
retries).

Tested-by: Guenter Roeck <linux at roeck-us.net>

Guenter



More information about the linux-arm-kernel mailing list