kernel_optimize_test/arch
Geert Uytterhoeven dbdf0f2207 mips: cm: Convert to bitfield API to fix out-of-bounds access
[ Upstream commit 18b8f5b6fc53d097cadb94a93d8d6566ba88e389 ]

mips_cm_error_report() extracts the cause and other cause from the error
register using shifts.  This works fine for the former, as it is stored
in the top bits, and the shift will thus remove all non-related bits.
However, the latter is stored in the bottom bits, hence thus needs masking
to get rid of non-related bits.  Without such masking, using it as an
index into the cm2_causes[] array will lead to an out-of-bounds access,
probably causing a crash.

Fix this by using FIELD_GET() instead.  Bite the bullet and convert all
MIPS CM handling to the bitfield API, to improve readability and safety.

Fixes: 3885c2b463 ("MIPS: CM: Add support for reporting CM cache errors")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 14:04:21 +01:00
..
alpha alpha: Declare virt_to_phys and virt_to_bus parameter as pointer to volatile 2021-09-30 10:11:07 +02:00
arc ARC: export clear_user_page() for modules 2021-09-22 12:28:04 +02:00
arm ARM: dts: stm32: fix AV96 board SAI2 pin muxing on stm32mp15 2021-11-18 14:04:19 +01:00
arm64 arm64: dts: qcom: pm8916: Remove wrong reg-names for rtc@6000 2021-11-18 14:04:15 +01:00
c6x arch-cleanup-2020-10-22 2020-10-23 10:06:38 -07:00
csky csky: Fixup regs.sr broken in ptrace 2021-10-20 11:44:58 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 11:02:28 +01:00
hexagon hexagon: use common DISCARDS macro 2021-07-20 16:05:53 +02:00
ia64 ia64: don't do IA64_CMPXCHG_DEBUG without CONFIG_PRINTK 2021-11-18 14:03:55 +01:00
m68k m68k: Handle arrivals of multiple signals correctly 2021-10-17 10:43:32 +02:00
microblaze local64.h: make <asm/local64.h> mandatory 2021-01-12 20:18:16 +01:00
mips mips: cm: Convert to bitfield API to fix out-of-bounds access 2021-11-18 14:04:21 +01:00
nds32 nds32: fix up stack guard gap 2021-07-28 14:35:46 +02:00
nios2 nios2: Make NIOS2_DTB_SOURCE_BOOL depend on !COMPILE_TEST 2021-11-02 19:48:23 +01:00
openrisc openrisc: don't printk() unconditionally 2021-09-18 13:40:13 +02:00
parisc parisc/kgdb: add kgdb_roundup() to make kgdb work with idle polling 2021-11-18 14:04:01 +01:00
powerpc powerpc/44x/fsp2: add missing of_node_put 2021-11-18 14:04:21 +01:00
riscv riscv: Fix asan-stack clang build 2021-11-02 19:48:25 +01:00
s390 KVM: s390: Fix handle_sske page fault handling 2021-11-18 14:04:11 +01:00
sh sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
sparc sparc64: fix pci_iounmap() when CONFIG_PCI is not set 2021-10-09 14:40:56 +02:00
um um: virtio_uml: fix memory leak on init failures 2021-09-26 14:08:57 +02:00
x86 x86/sev: Fix stack type check in vc_switch_off_ist() 2021-11-18 14:04:09 +01:00
xtensa xtensa: xtfpga: Try software restart before simulating CPU reset 2021-10-27 09:56:47 +02:00
.gitignore
Kconfig fanotify: Fix sys_fanotify_mark() on native x86-32 2021-01-17 14:16:59 +01:00