android_kernel_motorola_sm6375/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Marco Elver c78abaa8fe
UPSTREAM: kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE
Originally the addr != NULL check was meant to take care of the case
where __kfence_pool == NULL (KFENCE is disabled).  However, this does
not work for addresses where addr > 0 && addr < KFENCE_POOL_SIZE.

This can be the case on NULL-deref where addr > 0 && addr < PAGE_SIZE or
any other faulting access with addr < KFENCE_POOL_SIZE.  While the
kernel would likely crash, the stack traces and report might be
confusing due to double faults upon KFENCE's attempt to unprotect such
an address.

Fix it by just checking that __kfence_pool != NULL instead.

Link: https://lkml.kernel.org/r/20210818130300.2482437-1-elver@google.com
Fixes: 0ce20dd84089 ("mm: add Kernel Electric-Fence infrastructure")
Signed-off-by: Marco Elver <elver@google.com>
Reported-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Acked-by: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>    [5.12+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit a7cb5d23eaea148f8582229846f8dfff192f05c3)
Bug: 196937223
Bug: 197197917
Test: local QEMU runs with init/main.c modified to access the NULL page
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I6a339e8c6b4d2bdc3ee9bd575725489a8233aade
(cherry picked from commit 228d32e2d0b730f00eb0a8950698902b3ad23daf)
2026-05-07 17:24:09 +03:00
..
acpi
asm-generic UPSTREAM: seccomp: Use -1 marker for end of mode 1 syscall list 2026-05-07 10:17:17 -04:00
clocksource
crypto
drm
dt-bindings
keys
kvm
linux UPSTREAM: kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE 2026-05-07 17:24:09 +03:00
math-emu
media
misc
net Revert "wifi: cfg80211: Increase akm_suites array size in" 2026-05-05 20:02:19 +03:00
pcmcia
ras
rdma
scsi
soc
sound
target
trace FROMGIT: tracing: add error_report_end trace point 2026-05-07 17:24:05 +03:00
uapi UPSTREAM: net: retrieve netns cookie via getsocketopt 2026-05-07 10:18:28 -04:00
vdso
video
xen
OWNERS