Skip to content

Commit a08b41a

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: - Fix panic whe both KASAN and KPROBEs are enabled - Avoid alignment faults in copy_*_kernel_nofault() - Align SMP alternatives in modules * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9180/1: Thumb2: align ALT_UP() sections in modules sufficiently ARM: 9179/1: uaccess: avoid alignment faults in copy_[from|to]_kernel_nofault ARM: 9170/1: fix panic when kasan and kprobe are enabled
2 parents dd81e1c + 9f80ccd commit a08b41a

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

arch/arm/include/asm/assembler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
*/
289289
#define ALT_UP(instr...) \
290290
.pushsection ".alt.smp.init", "a" ;\
291+
.align 2 ;\
291292
.long 9998b - . ;\
292293
9997: instr ;\
293294
.if . - 9997b == 2 ;\
@@ -299,6 +300,7 @@
299300
.popsection
300301
#define ALT_UP_B(label) \
301302
.pushsection ".alt.smp.init", "a" ;\
303+
.align 2 ;\
302304
.long 9998b - . ;\
303305
W(b) . + (label - 9998b) ;\
304306
.popsection

arch/arm/include/asm/processor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ unsigned long __get_wchan(struct task_struct *p);
9696
#define __ALT_SMP_ASM(smp, up) \
9797
"9998: " smp "\n" \
9898
" .pushsection \".alt.smp.init\", \"a\"\n" \
99+
" .align 2\n" \
99100
" .long 9998b - .\n" \
100101
" " up "\n" \
101102
" .popsection\n"

arch/arm/include/asm/uaccess.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/string.h>
1212
#include <asm/memory.h>
1313
#include <asm/domain.h>
14+
#include <asm/unaligned.h>
1415
#include <asm/unified.h>
1516
#include <asm/compiler.h>
1617

@@ -497,7 +498,10 @@ do { \
497498
} \
498499
default: __err = __get_user_bad(); break; \
499500
} \
500-
*(type *)(dst) = __val; \
501+
if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) \
502+
put_unaligned(__val, (type *)(dst)); \
503+
else \
504+
*(type *)(dst) = __val; /* aligned by caller */ \
501505
if (__err) \
502506
goto err_label; \
503507
} while (0)
@@ -507,7 +511,9 @@ do { \
507511
const type *__pk_ptr = (dst); \
508512
unsigned long __dst = (unsigned long)__pk_ptr; \
509513
int __err = 0; \
510-
type __val = *(type *)src; \
514+
type __val = IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) \
515+
? get_unaligned((type *)(src)) \
516+
: *(type *)(src); /* aligned by caller */ \
511517
switch (sizeof(type)) { \
512518
case 1: __put_user_asm_byte(__val, __dst, __err, ""); break; \
513519
case 2: __put_user_asm_half(__val, __dst, __err, ""); break; \

arch/arm/probes/kprobes/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
KASAN_SANITIZE_actions-common.o := n
3+
KASAN_SANITIZE_actions-arm.o := n
4+
KASAN_SANITIZE_actions-thumb.o := n
25
obj-$(CONFIG_KPROBES) += core.o actions-common.o checkers-common.o
36
obj-$(CONFIG_ARM_KPROBES_TEST) += test-kprobes.o
47
test-kprobes-objs := test-core.o

0 commit comments

Comments
 (0)