Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'riscv-for-linus-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:
"A handful of fixes for 5.12:

- fix a stack tracing regression related to "const register asm"
variables, which have unexpected behavior.

- ensure the value to be written by put_user() is evaluated before
enabling access to userspace memory..

- align the exception vector table correctly, so we don't rely on the
firmware's handling of unaligned accesses.

- build fix to make NUMA depend on MMU, which triggered on some
randconfigs"

* tag 'riscv-for-linus-5.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: Make NUMA depend on MMU
riscv: remove unneeded semicolon
riscv,entry: fix misaligned base for excp_vect_table
riscv: evaluate put_user() arg before enabling user access
riscv: Drop const annotation for sp

+9 -5
+1 -1
arch/riscv/Kconfig
··· 314 314 # Common NUMA Features 315 315 config NUMA 316 316 bool "NUMA Memory Allocation and Scheduler Support" 317 - depends on SMP 317 + depends on SMP && MMU 318 318 select GENERIC_ARCH_NUMA 319 319 select OF_NUMA 320 320 select ARCH_SUPPORTS_NUMA_BALANCING
+5 -2
arch/riscv/include/asm/uaccess.h
··· 306 306 * data types like structures or arrays. 307 307 * 308 308 * @ptr must have pointer-to-simple-variable type, and @x must be assignable 309 - * to the result of dereferencing @ptr. 309 + * to the result of dereferencing @ptr. The value of @x is copied to avoid 310 + * re-ordering where @x is evaluated inside the block that enables user-space 311 + * access (thus bypassing user space protection if @x is a function). 310 312 * 311 313 * Caller must check the pointer with access_ok() before calling this 312 314 * function. ··· 318 316 #define __put_user(x, ptr) \ 319 317 ({ \ 320 318 __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ 319 + __typeof__(*__gu_ptr) __val = (x); \ 321 320 long __pu_err = 0; \ 322 321 \ 323 322 __chk_user_ptr(__gu_ptr); \ 324 323 \ 325 324 __enable_user_access(); \ 326 - __put_user_nocheck(x, __gu_ptr, __pu_err); \ 325 + __put_user_nocheck(__val, __gu_ptr, __pu_err); \ 327 326 __disable_user_access(); \ 328 327 \ 329 328 __pu_err; \
+1
arch/riscv/kernel/entry.S
··· 447 447 #endif 448 448 449 449 .section ".rodata" 450 + .align LGREG 450 451 /* Exception vector table */ 451 452 ENTRY(excp_vect_table) 452 453 RISCV_PTR do_trap_insn_misaligned
+1 -1
arch/riscv/kernel/stacktrace.c
··· 14 14 15 15 #include <asm/stacktrace.h> 16 16 17 - register const unsigned long sp_in_global __asm__("sp"); 17 + register unsigned long sp_in_global __asm__("sp"); 18 18 19 19 #ifdef CONFIG_FRAME_POINTER 20 20
+1 -1
arch/riscv/mm/kasan_init.c
··· 216 216 break; 217 217 218 218 kasan_populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end)); 219 - }; 219 + } 220 220 221 221 for (i = 0; i < PTRS_PER_PTE; i++) 222 222 set_pte(&kasan_early_shadow_pte[i],