kernel-fxtec-pro1x/arch
Linus Walleij cceec3c3cb ARM: 8978/1: mm: make act_mm() respect THREAD_SIZE
[ Upstream commit e1de94380af588bdf6ad6f0cc1f75004c35bc096 ]

Recent work with KASan exposed the folling hard-coded bitmask
in arch/arm/mm/proc-macros.S:

  bic     rd, sp, #8128
  bic     rd, rd, #63

This forms the bitmask 0x1FFF that is coinciding with
(PAGE_SIZE << THREAD_SIZE_ORDER) - 1, this code was assuming
that THREAD_SIZE is always 8K (8192).

As KASan was increasing THREAD_SIZE_ORDER to 2, I ran into
this bug.

Fix it by this little oneline suggested by Ard:

  bic     rd, sp, #(THREAD_SIZE - 1) & ~63

Where THREAD_SIZE is defined using THREAD_SIZE_ORDER.

We have to also include <linux/const.h> since the THREAD_SIZE
expands to use the _AC() macro.

Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-22 09:05:12 +02:00
..
alpha Fix 'acccess_ok()' on alpha and SH 2020-06-22 09:04:58 +02:00
arc ARC: [plat-eznps]: Restrict to CONFIG_ISA_ARCOMPACT 2020-06-07 13:17:55 +02:00
arm ARM: 8978/1: mm: make act_mm() respect THREAD_SIZE 2020-06-22 09:05:12 +02:00
arm64 arm64: insn: Fix two bugs in encoding 32-bit logical immediates 2020-06-22 09:05:10 +02:00
c6x
h8300
hexagon hexagon: define ioremap_uc 2020-05-10 10:30:11 +02:00
ia64 mm/memory_hotplug: shrink zones when offlining memory 2020-01-29 16:43:27 +01:00
m68k m68k: Call timer_interrupt() with interrupts disabled 2020-01-27 14:51:23 +01:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:34:53 +01:00
mips MIPS: Loongson: Build ATI Radeon GPU driver as module 2020-06-22 09:05:11 +02:00
nds32
nios2 nios2: ksyms: Add missing symbol exports 2020-01-27 14:50:30 +01:00
openrisc arch/openrisc: Fix issues with access_ok() 2020-06-22 09:04:59 +02:00
parisc parisc: Fix kernel panic in mem_init() 2020-06-03 08:19:42 +02:00
powerpc powerpc/xive: Clear the page tables for the ESB IO mapping 2020-06-22 09:05:00 +02:00
riscv riscv: stacktrace: Fix undefined reference to `walk_stackframe' 2020-06-03 08:19:30 +02:00
s390 s390/mm: fix set_huge_pte_at() for empty ptes 2020-06-07 13:17:56 +02:00
sh Fix 'acccess_ok()' on alpha and SH 2020-06-22 09:04:58 +02:00
sparc sparc: Add .exit.data section. 2020-02-24 08:34:37 +01:00
um um: ubd: Prevent buffer overrun on command completion 2020-04-23 10:30:19 +02:00
unicore32
x86 KVM: nVMX: Consult only the "basic" exit reason when routing nested exit 2020-06-22 09:05:06 +02:00
xtensa
.gitignore
Kconfig