https://github.com/torvalds/linux
Revision ec85bd369fd2bfaed6f45dd678706429d4f75b48 authored by Russell King (Oracle) on 26 July 2022, 22:51:48 UTC, committed by Russell King (Oracle) on 29 July 2022, 08:54:26 UTC
When offset is larger than the size of the bit array, we should not
attempt to access the array as we can perform an access beyond the
end of the array. Fix this by changing the pre-condition.

Using "cmp r2, r1; bhs ..." covers us for the size == 0 case, since
this will always take the branch when r1 is zero, irrespective of
the value of r2. This means we can fix this bug without adding any
additional code!

Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
1 parent fb0fd34
History
Tip revision: ec85bd369fd2bfaed6f45dd678706429d4f75b48 authored by Russell King (Oracle) on 26 July 2022, 22:51:48 UTC
ARM: findbit: fix overflowing offset
Tip revision: ec85bd3
File Mode Size
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format -rw-r--r-- 19.8 KB
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 71 bytes
.gitattributes -rw-r--r-- 62 bytes
.gitignore -rw-r--r-- 1.9 KB
.mailmap -rw-r--r-- 22.7 KB
COPYING -rw-r--r-- 496 bytes
CREDITS -rw-r--r-- 98.9 KB
Kbuild -rw-r--r-- 1.3 KB
Kconfig -rw-r--r-- 555 bytes
MAINTAINERS -rw-r--r-- 649.7 KB
Makefile -rw-r--r-- 63.9 KB
README -rw-r--r-- 727 bytes

README

back to top