[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220726183519.GA931941@roeck-us.net>
Date: Tue, 26 Jul 2022 11:35:19 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Yury Norov <yury.norov@...il.com>
Cc: linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Dennis Zhou <dennis@...nel.org>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] arm: drop arch implementation for find_bit() functions
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@...ck-us.net>
> CC: Dennis Zhou <dennis@...nel.org>
> CC: Russell King <linux@...linux.org.uk>
> CC: Catalin Marinas <catalin.marinas@....com>
> CC: linux-arm-kernel@...ts.infradead.org
> Reported-by: Guenter Roeck <linux@...ck-us.net>
> Suggested-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Yury Norov <yury.norov@...il.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@...ck-us.net>
Guenter
Powered by blists - more mailing lists