Skip to content

Commit c2b4385

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: - Fix clang-related relocation warning in futex code - Fix incorrect use of get_kernel_nofault() - Fix bad code generation in __get_user_check() when kasan is enabled - Ensure TLB function table is correctly aligned - Remove duplicated string function definitions in decompressor - Fix link-time orphan section warnings - Fix old-style function prototype for arch_init_kprobes() - Only warn about XIP address when not compile testing - Handle BE32 big endian for keystone2 remapping * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9148/1: handle CONFIG_CPU_ENDIAN_BE32 in arch/arm/kernel/head.S ARM: 9141/1: only warn about XIP address when not compile testing ARM: 9139/1: kprobes: fix arch_init_kprobes() prototype ARM: 9138/1: fix link warning with XIP + frame-pointer ARM: 9134/1: remove duplicate memcpy() definition ARM: 9133/1: mm: proc-macros: ensure *_tlb_fns are 4B aligned ARM: 9132/1: Fix __get_user_check failure with ARM KASAN images ARM: 9125/1: fix incorrect use of get_kernel_nofault() ARM: 9122/1: select HAVE_FUTEX_CMPXCHG
2 parents 4862649 + 00568b8 commit c2b4385

File tree

8 files changed

+17
-6
lines changed

8 files changed

+17
-6
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ config ARM
9292
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
9393
select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG
9494
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
95+
select HAVE_FUTEX_CMPXCHG if FUTEX
9596
select HAVE_GCC_PLUGINS
9697
select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)
9798
select HAVE_IRQ_TIME_ACCOUNTING

arch/arm/boot/compressed/decompress.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ extern char * strchrnul(const char *, int);
4747
#endif
4848

4949
#ifdef CONFIG_KERNEL_XZ
50+
/* Prevent KASAN override of string helpers in decompressor */
51+
#undef memmove
5052
#define memmove memmove
53+
#undef memcpy
5154
#define memcpy memcpy
5255
#include "../../../../lib/decompress_unxz.c"
5356
#endif

arch/arm/include/asm/uaccess.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ extern int __get_user_64t_4(void *);
176176
register unsigned long __l asm("r1") = __limit; \
177177
register int __e asm("r0"); \
178178
unsigned int __ua_flags = uaccess_save_and_enable(); \
179+
int __tmp_e; \
179180
switch (sizeof(*(__p))) { \
180181
case 1: \
181182
if (sizeof((x)) >= 8) \
@@ -203,9 +204,10 @@ extern int __get_user_64t_4(void *);
203204
break; \
204205
default: __e = __get_user_bad(); break; \
205206
} \
207+
__tmp_e = __e; \
206208
uaccess_restore(__ua_flags); \
207209
x = (typeof(*(p))) __r2; \
208-
__e; \
210+
__tmp_e; \
209211
})
210212

211213
#define get_user(x, p) \

arch/arm/kernel/head.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ __create_page_tables:
253253
add r0, r4, #KERNEL_OFFSET >> (SECTION_SHIFT - PMD_ORDER)
254254
ldr r6, =(_end - 1)
255255
adr_l r5, kernel_sec_start @ _pa(kernel_sec_start)
256-
#ifdef CONFIG_CPU_ENDIAN_BE8
256+
#if defined CONFIG_CPU_ENDIAN_BE8 || defined CONFIG_CPU_ENDIAN_BE32
257257
str r8, [r5, #4] @ Save physical start of kernel (BE)
258258
#else
259259
str r8, [r5] @ Save physical start of kernel (LE)
@@ -266,7 +266,7 @@ __create_page_tables:
266266
bls 1b
267267
eor r3, r3, r7 @ Remove the MMU flags
268268
adr_l r5, kernel_sec_end @ _pa(kernel_sec_end)
269-
#ifdef CONFIG_CPU_ENDIAN_BE8
269+
#if defined CONFIG_CPU_ENDIAN_BE8 || defined CONFIG_CPU_ENDIAN_BE32
270270
str r3, [r5, #4] @ Save physical end of kernel (BE)
271271
#else
272272
str r3, [r5] @ Save physical end of kernel (LE)

arch/arm/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
136136
for (p = first, i = 0; i < 8 && p < top; i++, p += 4) {
137137
if (p >= bottom && p < top) {
138138
unsigned long val;
139-
if (get_kernel_nofault(val, (unsigned long *)p))
139+
if (!get_kernel_nofault(val, (unsigned long *)p))
140140
sprintf(str + i * 9, " %08lx", val);
141141
else
142142
sprintf(str + i * 9, " ????????");

arch/arm/kernel/vmlinux-xip.lds.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ SECTIONS
4040
ARM_DISCARD
4141
*(.alt.smp.init)
4242
*(.pv_table)
43+
#ifndef CONFIG_ARM_UNWIND
44+
*(.ARM.exidx) *(.ARM.exidx.*)
45+
*(.ARM.extab) *(.ARM.extab.*)
46+
#endif
4347
}
4448

4549
. = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
@@ -172,7 +176,7 @@ ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")
172176
ASSERT((_end - __bss_start) >= 12288, ".bss too small for CONFIG_XIP_DEFLATED_DATA")
173177
#endif
174178

175-
#ifdef CONFIG_ARM_MPU
179+
#if defined(CONFIG_ARM_MPU) && !defined(CONFIG_COMPILE_TEST)
176180
/*
177181
* Due to PMSAv7 restriction on base address and size we have to
178182
* enforce minimal alignment restrictions. It was seen that weaker

arch/arm/mm/proc-macros.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ ENTRY(\name\()_cache_fns)
340340

341341
.macro define_tlb_functions name:req, flags_up:req, flags_smp
342342
.type \name\()_tlb_fns, #object
343+
.align 2
343344
ENTRY(\name\()_tlb_fns)
344345
.long \name\()_flush_user_tlb_range
345346
.long \name\()_flush_kern_tlb_range

arch/arm/probes/kprobes/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ static struct undef_hook kprobes_arm_break_hook = {
439439

440440
#endif /* !CONFIG_THUMB2_KERNEL */
441441

442-
int __init arch_init_kprobes()
442+
int __init arch_init_kprobes(void)
443443
{
444444
arm_probes_decode_init();
445445
#ifdef CONFIG_THUMB2_KERNEL

0 commit comments

Comments
 (0)