Commit a08b41ab authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents dd81e1c7 9f80ccda
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -288,6 +288,7 @@
 */
 */
#define ALT_UP(instr...)					\
#define ALT_UP(instr...)					\
	.pushsection ".alt.smp.init", "a"			;\
	.pushsection ".alt.smp.init", "a"			;\
	.align	2						;\
	.long	9998b - .					;\
	.long	9998b - .					;\
9997:	instr							;\
9997:	instr							;\
	.if . - 9997b == 2					;\
	.if . - 9997b == 2					;\
@@ -299,6 +300,7 @@
	.popsection
	.popsection
#define ALT_UP_B(label)					\
#define ALT_UP_B(label)					\
	.pushsection ".alt.smp.init", "a"			;\
	.pushsection ".alt.smp.init", "a"			;\
	.align	2						;\
	.long	9998b - .					;\
	.long	9998b - .					;\
	W(b)	. + (label - 9998b)					;\
	W(b)	. + (label - 9998b)					;\
	.popsection
	.popsection
+1 −0
Original line number Original line Diff line number Diff line
@@ -96,6 +96,7 @@ unsigned long __get_wchan(struct task_struct *p);
#define __ALT_SMP_ASM(smp, up)						\
#define __ALT_SMP_ASM(smp, up)						\
	"9998:	" smp "\n"						\
	"9998:	" smp "\n"						\
	"	.pushsection \".alt.smp.init\", \"a\"\n"		\
	"	.pushsection \".alt.smp.init\", \"a\"\n"		\
	"	.align	2\n"						\
	"	.long	9998b - .\n"					\
	"	.long	9998b - .\n"					\
	"	" up "\n"						\
	"	" up "\n"						\
	"	.popsection\n"
	"	.popsection\n"
+8 −2
Original line number Original line Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/string.h>
#include <linux/string.h>
#include <asm/memory.h>
#include <asm/memory.h>
#include <asm/domain.h>
#include <asm/domain.h>
#include <asm/unaligned.h>
#include <asm/unified.h>
#include <asm/unified.h>
#include <asm/compiler.h>
#include <asm/compiler.h>


@@ -497,7 +498,10 @@ do { \
	}								\
	}								\
	default: __err = __get_user_bad(); break;			\
	default: __err = __get_user_bad(); break;			\
	}								\
	}								\
	*(type *)(dst) = __val;						\
	if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS))		\
		put_unaligned(__val, (type *)(dst));			\
	else								\
		*(type *)(dst) = __val; /* aligned by caller */		\
	if (__err)							\
	if (__err)							\
		goto err_label;						\
		goto err_label;						\
} while (0)
} while (0)
@@ -507,7 +511,9 @@ do { \
	const type *__pk_ptr = (dst);					\
	const type *__pk_ptr = (dst);					\
	unsigned long __dst = (unsigned long)__pk_ptr;			\
	unsigned long __dst = (unsigned long)__pk_ptr;			\
	int __err = 0;							\
	int __err = 0;							\
	type __val = *(type *)src;					\
	type __val = IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)	\
		     ? get_unaligned((type *)(src))			\
		     : *(type *)(src);	/* aligned by caller */		\
	switch (sizeof(type)) {						\
	switch (sizeof(type)) {						\
	case 1: __put_user_asm_byte(__val, __dst, __err, ""); break;	\
	case 1: __put_user_asm_byte(__val, __dst, __err, ""); break;	\
	case 2:	__put_user_asm_half(__val, __dst, __err, ""); break;	\
	case 2:	__put_user_asm_half(__val, __dst, __err, ""); break;	\
+3 −0
Original line number Original line Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
# SPDX-License-Identifier: GPL-2.0
KASAN_SANITIZE_actions-common.o := n
KASAN_SANITIZE_actions-arm.o := n
KASAN_SANITIZE_actions-thumb.o := n
obj-$(CONFIG_KPROBES)		+= core.o actions-common.o checkers-common.o
obj-$(CONFIG_KPROBES)		+= core.o actions-common.o checkers-common.o
obj-$(CONFIG_ARM_KPROBES_TEST)	+= test-kprobes.o
obj-$(CONFIG_ARM_KPROBES_TEST)	+= test-kprobes.o
test-kprobes-objs		:= test-core.o
test-kprobes-objs		:= test-core.o