linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups
@ 2018-09-24  9:07 Eric W. Biederman
  2018-09-24  9:07 ` Eric W. Biederman
                   ` (16 more replies)
  0 siblings, 17 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel


This is the continuation of my work to sort out signaling of exceptions
with siginfo.  The old signal sending functions by taking a siginfo
argument resulted in their callers having to deal with the fiddly nature
of siginfo directly.  In small numbers of callers this is not a problem
but in the number of callers in the kernel this resulted in cases
where fields were not initialized or improperly initialized before
being passed to userspace.

To avoid having to worry about those issues I have added new signal
sending functions that each deal wit a different siginfo case.  When
using these functions there is no room for the fiddly nature of siginfo
to cause mistakes.

This is my set of changes to update arm64 to use those functions.
Along with some refactoring so those functions can be cleanly used.

Folks please review and double check me.  I think I have kept these
changes simple and obviously correct but I am human and mess up
sometimes.

After these patches have had a chance to be reviewed I plan to merge
them by my siginfo tree.  If you would rather take them in the arm64
tree let me know.   All of the prerequisites should have been merged
through Linus's tree several releases ago.

Eric W. Biederman (15):
      signal/arm64: Push siginfo generation into arm64_notify_die
      signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info
      signal/arm64: Factor out arm64_show_signal from arm64_force_sig_info
      signal/arm64: Factor set_thread_esr out of __do_user_fault
      signal/arm64: Consolidate the two hwpoison cases in do_page_fault
      signal/arm64: For clarity separate the 3 signal sending cases in do_page_fault
      signal/arm64: Expand __do_user_fault and remove it
      signal/arm64: Only perform one esr_to_fault_info call in do_page_fault
      signal/arm64: Only call set_thread_esr once in do_page_fault
      signal/arm64: Add and use arm64_force_sig_fault where appropriate
      signal/arm64: Add and use arm64_force_sig_mceerr as appropriate
      signal/arm64: Remove arm64_force_sig_info
      signal/arm64: In ptrace_hbptriggered name the signal description string
      signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap
      signal/arm64: Use send_sig_fault where appropriate

 arch/arm64/include/asm/system_misc.h |  3 +-
 arch/arm64/include/asm/traps.h       |  5 +-
 arch/arm64/kernel/debug-monitors.c   | 11 ++---
 arch/arm64/kernel/fpsimd.c           | 10 ++--
 arch/arm64/kernel/ptrace.c           | 16 +++---
 arch/arm64/kernel/sys_compat.c       | 13 ++---
 arch/arm64/kernel/traps.c            | 67 ++++++++++++-------------
 arch/arm64/mm/fault.c                | 94 +++++++++++++-----------------------
 8 files changed, 90 insertions(+), 129 deletions(-)

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
@ 2018-09-24  9:07 ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 01/15] signal/arm64: Push siginfo generation into arm64_notify_die Eric W. Biederman
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel


This is the continuation of my work to sort out signaling of exceptions
with siginfo.  The old signal sending functions by taking a siginfo
argument resulted in their callers having to deal with the fiddly nature
of siginfo directly.  In small numbers of callers this is not a problem
but in the number of callers in the kernel this resulted in cases
where fields were not initialized or improperly initialized before
being passed to userspace.

To avoid having to worry about those issues I have added new signal
sending functions that each deal wit a different siginfo case.  When
using these functions there is no room for the fiddly nature of siginfo
to cause mistakes.

This is my set of changes to update arm64 to use those functions.
Along with some refactoring so those functions can be cleanly used.

Folks please review and double check me.  I think I have kept these
changes simple and obviously correct but I am human and mess up
sometimes.

After these patches have had a chance to be reviewed I plan to merge
them by my siginfo tree.  If you would rather take them in the arm64
tree let me know.   All of the prerequisites should have been merged
through Linus's tree several releases ago.

Eric W. Biederman (15):
      signal/arm64: Push siginfo generation into arm64_notify_die
      signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info
      signal/arm64: Factor out arm64_show_signal from arm64_force_sig_info
      signal/arm64: Factor set_thread_esr out of __do_user_fault
      signal/arm64: Consolidate the two hwpoison cases in do_page_fault
      signal/arm64: For clarity separate the 3 signal sending cases in do_page_fault
      signal/arm64: Expand __do_user_fault and remove it
      signal/arm64: Only perform one esr_to_fault_info call in do_page_fault
      signal/arm64: Only call set_thread_esr once in do_page_fault
      signal/arm64: Add and use arm64_force_sig_fault where appropriate
      signal/arm64: Add and use arm64_force_sig_mceerr as appropriate
      signal/arm64: Remove arm64_force_sig_info
      signal/arm64: In ptrace_hbptriggered name the signal description string
      signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap
      signal/arm64: Use send_sig_fault where appropriate

 arch/arm64/include/asm/system_misc.h |  3 +-
 arch/arm64/include/asm/traps.h       |  5 +-
 arch/arm64/kernel/debug-monitors.c   | 11 ++---
 arch/arm64/kernel/fpsimd.c           | 10 ++--
 arch/arm64/kernel/ptrace.c           | 16 +++---
 arch/arm64/kernel/sys_compat.c       | 13 ++---
 arch/arm64/kernel/traps.c            | 67 ++++++++++++-------------
 arch/arm64/mm/fault.c                | 94 +++++++++++++-----------------------
 8 files changed, 90 insertions(+), 129 deletions(-)

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 01/15] signal/arm64: Push siginfo generation into arm64_notify_die
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
  2018-09-24  9:07 ` Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 02/15] signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info Eric W. Biederman
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Instead of generating a struct siginfo before calling arm64_notify_die
pass the signal number, tne sicode and the fault address into
arm64_notify_die and have it call force_sig_fault instead of
force_sig_info to let the generic code generate the struct siginfo.

This keeps code passing just the needed information into
siginfo generating code, making it easier to see what
is happening and harder to get wrong.  Further by letting
the generic code handle the generation of struct siginfo
it reduces the number of sites generating struct siginfo
making it possible to review them and verify that all
of the fiddly details for a structure passed to userspace
are handled properly.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/system_misc.h |  3 +-
 arch/arm64/kernel/sys_compat.c       | 13 ++++-----
 arch/arm64/kernel/traps.c            | 24 ++++++++--------
 arch/arm64/mm/fault.c                | 41 +++++++---------------------
 4 files changed, 30 insertions(+), 51 deletions(-)

diff --git a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h
index 28893a0b141d..0e2a0ecaf484 100644
--- a/arch/arm64/include/asm/system_misc.h
+++ b/arch/arm64/include/asm/system_misc.h
@@ -33,7 +33,8 @@ void die(const char *msg, struct pt_regs *regs, int err);
 
 struct siginfo;
 void arm64_notify_die(const char *str, struct pt_regs *regs,
-		      struct siginfo *info, int err);
+		      int signo, int sicode, void __user *addr,
+		      int err);
 
 void hook_debug_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
 					     struct pt_regs *),
diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c
index a6109825eeb9..32653d156747 100644
--- a/arch/arm64/kernel/sys_compat.c
+++ b/arch/arm64/kernel/sys_compat.c
@@ -68,8 +68,8 @@ do_compat_cache_op(unsigned long start, unsigned long end, int flags)
  */
 long compat_arm_syscall(struct pt_regs *regs)
 {
-	siginfo_t info;
 	unsigned int no = regs->regs[7];
+	void __user *addr;
 
 	switch (no) {
 	/*
@@ -112,13 +112,10 @@ long compat_arm_syscall(struct pt_regs *regs)
 		break;
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = SIGILL;
-	info.si_errno = 0;
-	info.si_code  = ILL_ILLTRP;
-	info.si_addr  = (void __user *)instruction_pointer(regs) -
-			 (compat_thumb_mode(regs) ? 2 : 4);
+	addr  = (void __user *)instruction_pointer(regs) -
+		(compat_thumb_mode(regs) ? 2 : 4);
 
-	arm64_notify_die("Oops - bad compat syscall(2)", regs, &info, no);
+	arm64_notify_die("Oops - bad compat syscall(2)", regs,
+			 SIGILL, ILL_ILLTRP, addr, no);
 	return 0;
 }
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 039e9ff379cc..459eb6fb7158 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -257,13 +257,23 @@ void arm64_force_sig_info(struct siginfo *info, const char *str,
 }
 
 void arm64_notify_die(const char *str, struct pt_regs *regs,
-		      struct siginfo *info, int err)
+		      int signo, int sicode, void __user *addr,
+		      int err)
 {
 	if (user_mode(regs)) {
+		struct siginfo info;
+
 		WARN_ON(regs != current_pt_regs());
 		current->thread.fault_address = 0;
 		current->thread.fault_code = err;
-		arm64_force_sig_info(info, str, current);
+
+		clear_siginfo(&info);
+		info.si_signo = signo;
+		info.si_errno = 0;
+		info.si_code  = sicode;
+		info.si_addr  = addr;
+
+		arm64_force_sig_info(&info, str, current);
 	} else {
 		die(str, regs, err);
 	}
@@ -348,12 +358,9 @@ static int call_undef_hook(struct pt_regs *regs)
 
 void force_signal_inject(int signal, int code, unsigned long address)
 {
-	siginfo_t info;
 	const char *desc;
 	struct pt_regs *regs = current_pt_regs();
 
-	clear_siginfo(&info);
-
 	switch (signal) {
 	case SIGILL:
 		desc = "undefined instruction";
@@ -372,12 +379,7 @@ void force_signal_inject(int signal, int code, unsigned long address)
 		signal = SIGKILL;
 	}
 
-	info.si_signo = signal;
-	info.si_errno = 0;
-	info.si_code  = code;
-	info.si_addr  = (void __user *)address;
-
-	arm64_notify_die(desc, regs, &info, 0);
+	arm64_notify_die(desc, regs, signal, code, (void __user *)address, 0);
 }
 
 /*
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 50b30ff30de4..86fe70d8722f 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -625,8 +625,8 @@ static int do_bad(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 
 static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 {
-	struct siginfo info;
 	const struct fault_info *inf;
+	void __user *siaddr;
 
 	inf = esr_to_fault_info(esr);
 
@@ -645,15 +645,11 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 			nmi_exit();
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = inf->sig;
-	info.si_errno = 0;
-	info.si_code  = inf->code;
 	if (esr & ESR_ELx_FnV)
-		info.si_addr = NULL;
+		siaddr = NULL;
 	else
-		info.si_addr  = (void __user *)addr;
-	arm64_notify_die(inf->name, regs, &info, esr);
+		siaddr  = (void __user *)addr;
+	arm64_notify_die(inf->name, regs, inf->sig, inf->code, siaddr, esr);
 
 	return 0;
 }
@@ -734,7 +730,6 @@ asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
 					 struct pt_regs *regs)
 {
 	const struct fault_info *inf = esr_to_fault_info(esr);
-	struct siginfo info;
 
 	if (!inf->fn(addr, esr, regs))
 		return;
@@ -745,12 +740,8 @@ asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
 		show_pte(addr);
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = inf->sig;
-	info.si_errno = 0;
-	info.si_code  = inf->code;
-	info.si_addr  = (void __user *)addr;
-	arm64_notify_die(inf->name, regs, &info, esr);
+	arm64_notify_die(inf->name, regs,
+			 inf->sig, inf->code, (void __user *)addr, esr);
 }
 
 asmlinkage void __exception do_el0_irq_bp_hardening(void)
@@ -780,20 +771,14 @@ asmlinkage void __exception do_sp_pc_abort(unsigned long addr,
 					   unsigned int esr,
 					   struct pt_regs *regs)
 {
-	struct siginfo info;
-
 	if (user_mode(regs)) {
 		if (instruction_pointer(regs) > TASK_SIZE)
 			arm64_apply_bp_hardening();
 		local_irq_enable();
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = SIGBUS;
-	info.si_errno = 0;
-	info.si_code  = BUS_ADRALN;
-	info.si_addr  = (void __user *)addr;
-	arm64_notify_die("SP/PC alignment exception", regs, &info, esr);
+	arm64_notify_die("SP/PC alignment exception", regs,
+			 SIGBUS, BUS_ADRALN, (void __user *)addr, esr);
 }
 
 int __init early_brk64(unsigned long addr, unsigned int esr,
@@ -847,14 +832,8 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
 	if (!inf->fn(addr, esr, regs)) {
 		rv = 1;
 	} else {
-		struct siginfo info;
-
-		clear_siginfo(&info);
-		info.si_signo = inf->sig;
-		info.si_errno = 0;
-		info.si_code  = inf->code;
-		info.si_addr  = (void __user *)addr;
-		arm64_notify_die(inf->name, regs, &info, esr);
+		arm64_notify_die(inf->name, regs,
+				 inf->sig, inf->code, (void __user *)addr, esr);
 		rv = 0;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 01/15] signal/arm64: Push siginfo generation into arm64_notify_die
  2018-09-24  9:10 ` [REVIEW][PATCH 01/15] signal/arm64: Push siginfo generation into arm64_notify_die Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Instead of generating a struct siginfo before calling arm64_notify_die
pass the signal number, tne sicode and the fault address into
arm64_notify_die and have it call force_sig_fault instead of
force_sig_info to let the generic code generate the struct siginfo.

This keeps code passing just the needed information into
siginfo generating code, making it easier to see what
is happening and harder to get wrong.  Further by letting
the generic code handle the generation of struct siginfo
it reduces the number of sites generating struct siginfo
making it possible to review them and verify that all
of the fiddly details for a structure passed to userspace
are handled properly.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/system_misc.h |  3 +-
 arch/arm64/kernel/sys_compat.c       | 13 ++++-----
 arch/arm64/kernel/traps.c            | 24 ++++++++--------
 arch/arm64/mm/fault.c                | 41 +++++++---------------------
 4 files changed, 30 insertions(+), 51 deletions(-)

diff --git a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h
index 28893a0b141d..0e2a0ecaf484 100644
--- a/arch/arm64/include/asm/system_misc.h
+++ b/arch/arm64/include/asm/system_misc.h
@@ -33,7 +33,8 @@ void die(const char *msg, struct pt_regs *regs, int err);
 
 struct siginfo;
 void arm64_notify_die(const char *str, struct pt_regs *regs,
-		      struct siginfo *info, int err);
+		      int signo, int sicode, void __user *addr,
+		      int err);
 
 void hook_debug_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
 					     struct pt_regs *),
diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c
index a6109825eeb9..32653d156747 100644
--- a/arch/arm64/kernel/sys_compat.c
+++ b/arch/arm64/kernel/sys_compat.c
@@ -68,8 +68,8 @@ do_compat_cache_op(unsigned long start, unsigned long end, int flags)
  */
 long compat_arm_syscall(struct pt_regs *regs)
 {
-	siginfo_t info;
 	unsigned int no = regs->regs[7];
+	void __user *addr;
 
 	switch (no) {
 	/*
@@ -112,13 +112,10 @@ long compat_arm_syscall(struct pt_regs *regs)
 		break;
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = SIGILL;
-	info.si_errno = 0;
-	info.si_code  = ILL_ILLTRP;
-	info.si_addr  = (void __user *)instruction_pointer(regs) -
-			 (compat_thumb_mode(regs) ? 2 : 4);
+	addr  = (void __user *)instruction_pointer(regs) -
+		(compat_thumb_mode(regs) ? 2 : 4);
 
-	arm64_notify_die("Oops - bad compat syscall(2)", regs, &info, no);
+	arm64_notify_die("Oops - bad compat syscall(2)", regs,
+			 SIGILL, ILL_ILLTRP, addr, no);
 	return 0;
 }
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 039e9ff379cc..459eb6fb7158 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -257,13 +257,23 @@ void arm64_force_sig_info(struct siginfo *info, const char *str,
 }
 
 void arm64_notify_die(const char *str, struct pt_regs *regs,
-		      struct siginfo *info, int err)
+		      int signo, int sicode, void __user *addr,
+		      int err)
 {
 	if (user_mode(regs)) {
+		struct siginfo info;
+
 		WARN_ON(regs != current_pt_regs());
 		current->thread.fault_address = 0;
 		current->thread.fault_code = err;
-		arm64_force_sig_info(info, str, current);
+
+		clear_siginfo(&info);
+		info.si_signo = signo;
+		info.si_errno = 0;
+		info.si_code  = sicode;
+		info.si_addr  = addr;
+
+		arm64_force_sig_info(&info, str, current);
 	} else {
 		die(str, regs, err);
 	}
@@ -348,12 +358,9 @@ static int call_undef_hook(struct pt_regs *regs)
 
 void force_signal_inject(int signal, int code, unsigned long address)
 {
-	siginfo_t info;
 	const char *desc;
 	struct pt_regs *regs = current_pt_regs();
 
-	clear_siginfo(&info);
-
 	switch (signal) {
 	case SIGILL:
 		desc = "undefined instruction";
@@ -372,12 +379,7 @@ void force_signal_inject(int signal, int code, unsigned long address)
 		signal = SIGKILL;
 	}
 
-	info.si_signo = signal;
-	info.si_errno = 0;
-	info.si_code  = code;
-	info.si_addr  = (void __user *)address;
-
-	arm64_notify_die(desc, regs, &info, 0);
+	arm64_notify_die(desc, regs, signal, code, (void __user *)address, 0);
 }
 
 /*
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 50b30ff30de4..86fe70d8722f 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -625,8 +625,8 @@ static int do_bad(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 
 static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 {
-	struct siginfo info;
 	const struct fault_info *inf;
+	void __user *siaddr;
 
 	inf = esr_to_fault_info(esr);
 
@@ -645,15 +645,11 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 			nmi_exit();
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = inf->sig;
-	info.si_errno = 0;
-	info.si_code  = inf->code;
 	if (esr & ESR_ELx_FnV)
-		info.si_addr = NULL;
+		siaddr = NULL;
 	else
-		info.si_addr  = (void __user *)addr;
-	arm64_notify_die(inf->name, regs, &info, esr);
+		siaddr  = (void __user *)addr;
+	arm64_notify_die(inf->name, regs, inf->sig, inf->code, siaddr, esr);
 
 	return 0;
 }
@@ -734,7 +730,6 @@ asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
 					 struct pt_regs *regs)
 {
 	const struct fault_info *inf = esr_to_fault_info(esr);
-	struct siginfo info;
 
 	if (!inf->fn(addr, esr, regs))
 		return;
@@ -745,12 +740,8 @@ asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
 		show_pte(addr);
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = inf->sig;
-	info.si_errno = 0;
-	info.si_code  = inf->code;
-	info.si_addr  = (void __user *)addr;
-	arm64_notify_die(inf->name, regs, &info, esr);
+	arm64_notify_die(inf->name, regs,
+			 inf->sig, inf->code, (void __user *)addr, esr);
 }
 
 asmlinkage void __exception do_el0_irq_bp_hardening(void)
@@ -780,20 +771,14 @@ asmlinkage void __exception do_sp_pc_abort(unsigned long addr,
 					   unsigned int esr,
 					   struct pt_regs *regs)
 {
-	struct siginfo info;
-
 	if (user_mode(regs)) {
 		if (instruction_pointer(regs) > TASK_SIZE)
 			arm64_apply_bp_hardening();
 		local_irq_enable();
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = SIGBUS;
-	info.si_errno = 0;
-	info.si_code  = BUS_ADRALN;
-	info.si_addr  = (void __user *)addr;
-	arm64_notify_die("SP/PC alignment exception", regs, &info, esr);
+	arm64_notify_die("SP/PC alignment exception", regs,
+			 SIGBUS, BUS_ADRALN, (void __user *)addr, esr);
 }
 
 int __init early_brk64(unsigned long addr, unsigned int esr,
@@ -847,14 +832,8 @@ asmlinkage int __exception do_debug_exception(unsigned long addr,
 	if (!inf->fn(addr, esr, regs)) {
 		rv = 1;
 	} else {
-		struct siginfo info;
-
-		clear_siginfo(&info);
-		info.si_signo = inf->sig;
-		info.si_errno = 0;
-		info.si_code  = inf->code;
-		info.si_addr  = (void __user *)addr;
-		arm64_notify_die(inf->name, regs, &info, esr);
+		arm64_notify_die(inf->name, regs,
+				 inf->sig, inf->code, (void __user *)addr, esr);
 		rv = 0;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 02/15] signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
  2018-09-24  9:07 ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 01/15] signal/arm64: Push siginfo generation into arm64_notify_die Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 03/15] signal/arm64: Factor out arm64_show_signal " Eric W. Biederman
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Every caller passes in current for tsk so there is no need to pass
tsk.  Instead make tsk a local variable initialized to current.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h     | 3 +--
 arch/arm64/kernel/debug-monitors.c | 2 +-
 arch/arm64/kernel/ptrace.c         | 2 +-
 arch/arm64/kernel/traps.c          | 8 ++++----
 arch/arm64/mm/fault.c              | 2 +-
 5 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index c320f3bf6c57..cd3a2ca9c179 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -37,8 +37,7 @@ void register_undef_hook(struct undef_hook *hook);
 void unregister_undef_hook(struct undef_hook *hook);
 void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
-void arm64_force_sig_info(struct siginfo *info, const char *str,
-			  struct task_struct *tsk);
+void arm64_force_sig_info(struct siginfo *info, const char *str);
 
 /*
  * Move regs->pc to next instruction and do necessary setup before it
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 06ca574495af..e0d9502be5bf 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -224,7 +224,7 @@ static void send_user_sigtrap(int si_code)
 	if (interrupts_enabled(regs))
 		local_irq_enable();
 
-	arm64_force_sig_info(&info, "User debug trap", current);
+	arm64_force_sig_info(&info, "User debug trap");
 }
 
 static int single_step_handler(unsigned long addr, unsigned int esr,
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 6219486fa25f..20b68cb31ecb 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -211,7 +211,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 		force_sig_ptrace_errno_trap(si_errno, (void __user *)bkpt->trigger);
 	}
 #endif
-	arm64_force_sig_info(&info, "Hardware breakpoint trap (ptrace)", current);
+	arm64_force_sig_info(&info, "Hardware breakpoint trap (ptrace)");
 }
 
 /*
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 459eb6fb7158..24035d124608 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -231,9 +231,9 @@ static bool show_unhandled_signals_ratelimited(void)
 	return show_unhandled_signals && __ratelimit(&rs);
 }
 
-void arm64_force_sig_info(struct siginfo *info, const char *str,
-			  struct task_struct *tsk)
+void arm64_force_sig_info(struct siginfo *info, const char *str)
 {
+	struct task_struct *tsk = current;
 	unsigned int esr = tsk->thread.fault_code;
 	struct pt_regs *regs = task_pt_regs(tsk);
 
@@ -273,7 +273,7 @@ void arm64_notify_die(const char *str, struct pt_regs *regs,
 		info.si_code  = sicode;
 		info.si_addr  = addr;
 
-		arm64_force_sig_info(&info, str, current);
+		arm64_force_sig_info(&info, str);
 	} else {
 		die(str, regs, err);
 	}
@@ -630,7 +630,7 @@ asmlinkage void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
 	current->thread.fault_address = 0;
 	current->thread.fault_code = esr;
 
-	arm64_force_sig_info(&info, "Bad EL0 synchronous exception", current);
+	arm64_force_sig_info(&info, "Bad EL0 synchronous exception");
 }
 
 #ifdef CONFIG_VMAP_STACK
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 86fe70d8722f..f42aff0e90ad 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -352,7 +352,7 @@ static void __do_user_fault(struct siginfo *info, unsigned int esr)
 	}
 
 	current->thread.fault_code = esr;
-	arm64_force_sig_info(info, esr_to_fault_info(esr)->name, current);
+	arm64_force_sig_info(info, esr_to_fault_info(esr)->name);
 }
 
 static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 02/15] signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info
  2018-09-24  9:10 ` [REVIEW][PATCH 02/15] signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Every caller passes in current for tsk so there is no need to pass
tsk.  Instead make tsk a local variable initialized to current.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h     | 3 +--
 arch/arm64/kernel/debug-monitors.c | 2 +-
 arch/arm64/kernel/ptrace.c         | 2 +-
 arch/arm64/kernel/traps.c          | 8 ++++----
 arch/arm64/mm/fault.c              | 2 +-
 5 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index c320f3bf6c57..cd3a2ca9c179 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -37,8 +37,7 @@ void register_undef_hook(struct undef_hook *hook);
 void unregister_undef_hook(struct undef_hook *hook);
 void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
-void arm64_force_sig_info(struct siginfo *info, const char *str,
-			  struct task_struct *tsk);
+void arm64_force_sig_info(struct siginfo *info, const char *str);
 
 /*
  * Move regs->pc to next instruction and do necessary setup before it
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 06ca574495af..e0d9502be5bf 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -224,7 +224,7 @@ static void send_user_sigtrap(int si_code)
 	if (interrupts_enabled(regs))
 		local_irq_enable();
 
-	arm64_force_sig_info(&info, "User debug trap", current);
+	arm64_force_sig_info(&info, "User debug trap");
 }
 
 static int single_step_handler(unsigned long addr, unsigned int esr,
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 6219486fa25f..20b68cb31ecb 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -211,7 +211,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 		force_sig_ptrace_errno_trap(si_errno, (void __user *)bkpt->trigger);
 	}
 #endif
-	arm64_force_sig_info(&info, "Hardware breakpoint trap (ptrace)", current);
+	arm64_force_sig_info(&info, "Hardware breakpoint trap (ptrace)");
 }
 
 /*
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 459eb6fb7158..24035d124608 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -231,9 +231,9 @@ static bool show_unhandled_signals_ratelimited(void)
 	return show_unhandled_signals && __ratelimit(&rs);
 }
 
-void arm64_force_sig_info(struct siginfo *info, const char *str,
-			  struct task_struct *tsk)
+void arm64_force_sig_info(struct siginfo *info, const char *str)
 {
+	struct task_struct *tsk = current;
 	unsigned int esr = tsk->thread.fault_code;
 	struct pt_regs *regs = task_pt_regs(tsk);
 
@@ -273,7 +273,7 @@ void arm64_notify_die(const char *str, struct pt_regs *regs,
 		info.si_code  = sicode;
 		info.si_addr  = addr;
 
-		arm64_force_sig_info(&info, str, current);
+		arm64_force_sig_info(&info, str);
 	} else {
 		die(str, regs, err);
 	}
@@ -630,7 +630,7 @@ asmlinkage void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
 	current->thread.fault_address = 0;
 	current->thread.fault_code = esr;
 
-	arm64_force_sig_info(&info, "Bad EL0 synchronous exception", current);
+	arm64_force_sig_info(&info, "Bad EL0 synchronous exception");
 }
 
 #ifdef CONFIG_VMAP_STACK
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 86fe70d8722f..f42aff0e90ad 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -352,7 +352,7 @@ static void __do_user_fault(struct siginfo *info, unsigned int esr)
 	}
 
 	current->thread.fault_code = esr;
-	arm64_force_sig_info(info, esr_to_fault_info(esr)->name, current);
+	arm64_force_sig_info(info, esr_to_fault_info(esr)->name);
 }
 
 static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 03/15] signal/arm64: Factor out arm64_show_signal from arm64_force_sig_info
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (2 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 02/15] signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 04/15] signal/arm64: Factor set_thread_esr out of __do_user_fault Eric W. Biederman
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Filling in siginfo is error prone and so it is wise to use more
specialized helpers to do that work.  Factor out the arm specific
unhandled signal reporting from the work of delivering a signal so
the code can be modified to use functions that take the information
to fill out siginfo as parameters.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/kernel/traps.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 24035d124608..daee8c2ca561 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -224,24 +224,19 @@ void die(const char *str, struct pt_regs *regs, int err)
 		do_exit(SIGSEGV);
 }
 
-static bool show_unhandled_signals_ratelimited(void)
+static void arm64_show_signal(int signo, const char *str)
 {
 	static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL,
 				      DEFAULT_RATELIMIT_BURST);
-	return show_unhandled_signals && __ratelimit(&rs);
-}
-
-void arm64_force_sig_info(struct siginfo *info, const char *str)
-{
 	struct task_struct *tsk = current;
 	unsigned int esr = tsk->thread.fault_code;
 	struct pt_regs *regs = task_pt_regs(tsk);
 
-	if (!unhandled_signal(tsk, info->si_signo))
-		goto send_sig;
-
-	if (!show_unhandled_signals_ratelimited())
-		goto send_sig;
+	/* Leave if the signal won't be shown */
+	if (!show_unhandled_signals ||
+	    !unhandled_signal(tsk, signo) ||
+	    !__ratelimit(&rs))
+		return;
 
 	pr_info("%s[%d]: unhandled exception: ", tsk->comm, task_pid_nr(tsk));
 	if (esr)
@@ -251,9 +246,12 @@ void arm64_force_sig_info(struct siginfo *info, const char *str)
 	print_vma_addr(KERN_CONT " in ", regs->pc);
 	pr_cont("\n");
 	__show_regs(regs);
+}
 
-send_sig:
-	force_sig_info(info->si_signo, info, tsk);
+void arm64_force_sig_info(struct siginfo *info, const char *str)
+{
+	arm64_show_signal(info->si_signo, str);
+	force_sig_info(info->si_signo, info, current);
 }
 
 void arm64_notify_die(const char *str, struct pt_regs *regs,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 03/15] signal/arm64: Factor out arm64_show_signal from arm64_force_sig_info
  2018-09-24  9:10 ` [REVIEW][PATCH 03/15] signal/arm64: Factor out arm64_show_signal " Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Filling in siginfo is error prone and so it is wise to use more
specialized helpers to do that work.  Factor out the arm specific
unhandled signal reporting from the work of delivering a signal so
the code can be modified to use functions that take the information
to fill out siginfo as parameters.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/kernel/traps.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 24035d124608..daee8c2ca561 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -224,24 +224,19 @@ void die(const char *str, struct pt_regs *regs, int err)
 		do_exit(SIGSEGV);
 }
 
-static bool show_unhandled_signals_ratelimited(void)
+static void arm64_show_signal(int signo, const char *str)
 {
 	static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL,
 				      DEFAULT_RATELIMIT_BURST);
-	return show_unhandled_signals && __ratelimit(&rs);
-}
-
-void arm64_force_sig_info(struct siginfo *info, const char *str)
-{
 	struct task_struct *tsk = current;
 	unsigned int esr = tsk->thread.fault_code;
 	struct pt_regs *regs = task_pt_regs(tsk);
 
-	if (!unhandled_signal(tsk, info->si_signo))
-		goto send_sig;
-
-	if (!show_unhandled_signals_ratelimited())
-		goto send_sig;
+	/* Leave if the signal won't be shown */
+	if (!show_unhandled_signals ||
+	    !unhandled_signal(tsk, signo) ||
+	    !__ratelimit(&rs))
+		return;
 
 	pr_info("%s[%d]: unhandled exception: ", tsk->comm, task_pid_nr(tsk));
 	if (esr)
@@ -251,9 +246,12 @@ void arm64_force_sig_info(struct siginfo *info, const char *str)
 	print_vma_addr(KERN_CONT " in ", regs->pc);
 	pr_cont("\n");
 	__show_regs(regs);
+}
 
-send_sig:
-	force_sig_info(info->si_signo, info, tsk);
+void arm64_force_sig_info(struct siginfo *info, const char *str)
+{
+	arm64_show_signal(info->si_signo, str);
+	force_sig_info(info->si_signo, info, current);
 }
 
 void arm64_notify_die(const char *str, struct pt_regs *regs,
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 04/15] signal/arm64: Factor set_thread_esr out of __do_user_fault
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (3 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 03/15] signal/arm64: Factor out arm64_show_signal " Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 05/15] signal/arm64: Consolidate the two hwpoison cases in do_page_fault Eric W. Biederman
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

This pepares for sending signals with something other than
arm64_force_sig_info.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index f42aff0e90ad..654a861c4bd0 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -297,9 +297,9 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
 	die_kernel_fault(msg, addr, esr, regs);
 }
 
-static void __do_user_fault(struct siginfo *info, unsigned int esr)
+static void set_thread_esr(unsigned long address, unsigned int esr)
 {
-	current->thread.fault_address = (unsigned long)info->si_addr;
+	current->thread.fault_address = address;
 
 	/*
 	 * If the faulting address is in the kernel, we must sanitize the ESR.
@@ -352,6 +352,11 @@ static void __do_user_fault(struct siginfo *info, unsigned int esr)
 	}
 
 	current->thread.fault_code = esr;
+}
+
+static void __do_user_fault(struct siginfo *info, unsigned int esr)
+{
+	set_thread_esr((unsigned long)info->si_addr, esr);
 	arm64_force_sig_info(info, esr_to_fault_info(esr)->name);
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 04/15] signal/arm64: Factor set_thread_esr out of __do_user_fault
  2018-09-24  9:10 ` [REVIEW][PATCH 04/15] signal/arm64: Factor set_thread_esr out of __do_user_fault Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

This pepares for sending signals with something other than
arm64_force_sig_info.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index f42aff0e90ad..654a861c4bd0 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -297,9 +297,9 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
 	die_kernel_fault(msg, addr, esr, regs);
 }
 
-static void __do_user_fault(struct siginfo *info, unsigned int esr)
+static void set_thread_esr(unsigned long address, unsigned int esr)
 {
-	current->thread.fault_address = (unsigned long)info->si_addr;
+	current->thread.fault_address = address;
 
 	/*
 	 * If the faulting address is in the kernel, we must sanitize the ESR.
@@ -352,6 +352,11 @@ static void __do_user_fault(struct siginfo *info, unsigned int esr)
 	}
 
 	current->thread.fault_code = esr;
+}
+
+static void __do_user_fault(struct siginfo *info, unsigned int esr)
+{
+	set_thread_esr((unsigned long)info->si_addr, esr);
 	arm64_force_sig_info(info, esr_to_fault_info(esr)->name);
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 05/15] signal/arm64: Consolidate the two hwpoison cases in do_page_fault
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (4 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 04/15] signal/arm64: Factor set_thread_esr out of __do_user_fault Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 06/15] signal/arm64: For clarity separate the 3 signal sending " Eric W. Biederman
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

These two cases are practically the same and use siginfo differently
from the other signals sent from do_page_fault.  So consolidate them
to make future changes easier.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 654a861c4bd0..0ddc8c6ba53b 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -577,16 +577,16 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		 */
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_ADRERR;
-	} else if (fault & VM_FAULT_HWPOISON_LARGE) {
-		unsigned int hindex = VM_FAULT_GET_HINDEX(fault);
+	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
+		unsigned int lsb;
+
+		lsb = PAGE_SHIFT;
+		if (fault & VM_FAULT_HWPOISON_LARGE)
+			lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
 
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_MCEERR_AR;
-		si.si_addr_lsb	= hstate_index_to_shift(hindex);
-	} else if (fault & VM_FAULT_HWPOISON) {
-		si.si_signo	= SIGBUS;
-		si.si_code	= BUS_MCEERR_AR;
-		si.si_addr_lsb	= PAGE_SHIFT;
+		si.si_addr_lsb	= lsb;
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 05/15] signal/arm64: Consolidate the two hwpoison cases in do_page_fault
  2018-09-24  9:10 ` [REVIEW][PATCH 05/15] signal/arm64: Consolidate the two hwpoison cases in do_page_fault Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

These two cases are practically the same and use siginfo differently
from the other signals sent from do_page_fault.  So consolidate them
to make future changes easier.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 654a861c4bd0..0ddc8c6ba53b 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -577,16 +577,16 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		 */
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_ADRERR;
-	} else if (fault & VM_FAULT_HWPOISON_LARGE) {
-		unsigned int hindex = VM_FAULT_GET_HINDEX(fault);
+	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
+		unsigned int lsb;
+
+		lsb = PAGE_SHIFT;
+		if (fault & VM_FAULT_HWPOISON_LARGE)
+			lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
 
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_MCEERR_AR;
-		si.si_addr_lsb	= hstate_index_to_shift(hindex);
-	} else if (fault & VM_FAULT_HWPOISON) {
-		si.si_signo	= SIGBUS;
-		si.si_code	= BUS_MCEERR_AR;
-		si.si_addr_lsb	= PAGE_SHIFT;
+		si.si_addr_lsb	= lsb;
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 06/15] signal/arm64: For clarity separate the 3 signal sending cases in do_page_fault
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (5 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 05/15] signal/arm64: Consolidate the two hwpoison cases in do_page_fault Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 07/15] signal/arm64: Expand __do_user_fault and remove it Eric W. Biederman
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

It gets easy to confuse what is going on when some code is shared and some not
so stop sharing the trivial bits of signal generation to make future updates
easier to understand.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 0ddc8c6ba53b..14d6ff895139 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -567,16 +567,16 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		return 0;
 	}
 
-	clear_siginfo(&si);
-	si.si_addr = (void __user *)addr;
-
 	if (fault & VM_FAULT_SIGBUS) {
 		/*
 		 * We had some memory, but were unable to successfully fix up
 		 * this page fault.
 		 */
+		clear_siginfo(&si);
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_ADRERR;
+		si.si_addr = (void __user *)addr;
+		__do_user_fault(&si, esr);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
 
@@ -584,20 +584,25 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		if (fault & VM_FAULT_HWPOISON_LARGE)
 			lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
 
+		clear_siginfo(&si);
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_MCEERR_AR;
+		si.si_addr = (void __user *)addr;
 		si.si_addr_lsb	= lsb;
+		__do_user_fault(&si, esr);
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
 		 * map.
 		 */
+		clear_siginfo(&si);
 		si.si_signo	= SIGSEGV;
 		si.si_code	= fault == VM_FAULT_BADACCESS ?
 				  SEGV_ACCERR : SEGV_MAPERR;
+		si.si_addr = (void __user *)addr;
+		__do_user_fault(&si, esr);
 	}
 
-	__do_user_fault(&si, esr);
 	return 0;
 
 no_context:
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 06/15] signal/arm64: For clarity separate the 3 signal sending cases in do_page_fault
  2018-09-24  9:10 ` [REVIEW][PATCH 06/15] signal/arm64: For clarity separate the 3 signal sending " Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

It gets easy to confuse what is going on when some code is shared and some not
so stop sharing the trivial bits of signal generation to make future updates
easier to understand.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 0ddc8c6ba53b..14d6ff895139 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -567,16 +567,16 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		return 0;
 	}
 
-	clear_siginfo(&si);
-	si.si_addr = (void __user *)addr;
-
 	if (fault & VM_FAULT_SIGBUS) {
 		/*
 		 * We had some memory, but were unable to successfully fix up
 		 * this page fault.
 		 */
+		clear_siginfo(&si);
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_ADRERR;
+		si.si_addr = (void __user *)addr;
+		__do_user_fault(&si, esr);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
 
@@ -584,20 +584,25 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		if (fault & VM_FAULT_HWPOISON_LARGE)
 			lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
 
+		clear_siginfo(&si);
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_MCEERR_AR;
+		si.si_addr = (void __user *)addr;
 		si.si_addr_lsb	= lsb;
+		__do_user_fault(&si, esr);
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
 		 * map.
 		 */
+		clear_siginfo(&si);
 		si.si_signo	= SIGSEGV;
 		si.si_code	= fault == VM_FAULT_BADACCESS ?
 				  SEGV_ACCERR : SEGV_MAPERR;
+		si.si_addr = (void __user *)addr;
+		__do_user_fault(&si, esr);
 	}
 
-	__do_user_fault(&si, esr);
 	return 0;
 
 no_context:
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 07/15] signal/arm64: Expand __do_user_fault and remove it
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (6 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 06/15] signal/arm64: For clarity separate the 3 signal sending " Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 08/15] signal/arm64: Only perform one esr_to_fault_info call in do_page_fault Eric W. Biederman
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Not all of the signals passed to __do_user_fault can be handled
the same way so expand the now tiny __do_user_fault in it's callers
and remove it.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 14d6ff895139..7df3d8b561c2 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -354,12 +354,6 @@ static void set_thread_esr(unsigned long address, unsigned int esr)
 	current->thread.fault_code = esr;
 }
 
-static void __do_user_fault(struct siginfo *info, unsigned int esr)
-{
-	set_thread_esr((unsigned long)info->si_addr, esr);
-	arm64_force_sig_info(info, esr_to_fault_info(esr)->name);
-}
-
 static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 {
 	/*
@@ -375,7 +369,8 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
 		si.si_code	= inf->code;
 		si.si_addr	= (void __user *)addr;
 
-		__do_user_fault(&si, esr);
+		set_thread_esr(addr, esr);
+		arm64_force_sig_info(&si, inf->name);
 	} else {
 		__do_kernel_fault(addr, esr, regs);
 	}
@@ -576,7 +571,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_ADRERR;
 		si.si_addr = (void __user *)addr;
-		__do_user_fault(&si, esr);
+		set_thread_esr(addr, esr);
+		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
 
@@ -589,7 +585,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= BUS_MCEERR_AR;
 		si.si_addr = (void __user *)addr;
 		si.si_addr_lsb	= lsb;
-		__do_user_fault(&si, esr);
+		set_thread_esr(addr, esr);
+		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
@@ -600,7 +597,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= fault == VM_FAULT_BADACCESS ?
 				  SEGV_ACCERR : SEGV_MAPERR;
 		si.si_addr = (void __user *)addr;
-		__do_user_fault(&si, esr);
+		set_thread_esr(addr, esr);
+		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
 	}
 
 	return 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 07/15] signal/arm64: Expand __do_user_fault and remove it
  2018-09-24  9:10 ` [REVIEW][PATCH 07/15] signal/arm64: Expand __do_user_fault and remove it Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Not all of the signals passed to __do_user_fault can be handled
the same way so expand the now tiny __do_user_fault in it's callers
and remove it.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 14d6ff895139..7df3d8b561c2 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -354,12 +354,6 @@ static void set_thread_esr(unsigned long address, unsigned int esr)
 	current->thread.fault_code = esr;
 }
 
-static void __do_user_fault(struct siginfo *info, unsigned int esr)
-{
-	set_thread_esr((unsigned long)info->si_addr, esr);
-	arm64_force_sig_info(info, esr_to_fault_info(esr)->name);
-}
-
 static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 {
 	/*
@@ -375,7 +369,8 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
 		si.si_code	= inf->code;
 		si.si_addr	= (void __user *)addr;
 
-		__do_user_fault(&si, esr);
+		set_thread_esr(addr, esr);
+		arm64_force_sig_info(&si, inf->name);
 	} else {
 		__do_kernel_fault(addr, esr, regs);
 	}
@@ -576,7 +571,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_ADRERR;
 		si.si_addr = (void __user *)addr;
-		__do_user_fault(&si, esr);
+		set_thread_esr(addr, esr);
+		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
 
@@ -589,7 +585,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= BUS_MCEERR_AR;
 		si.si_addr = (void __user *)addr;
 		si.si_addr_lsb	= lsb;
-		__do_user_fault(&si, esr);
+		set_thread_esr(addr, esr);
+		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
@@ -600,7 +597,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= fault == VM_FAULT_BADACCESS ?
 				  SEGV_ACCERR : SEGV_MAPERR;
 		si.si_addr = (void __user *)addr;
-		__do_user_fault(&si, esr);
+		set_thread_esr(addr, esr);
+		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
 	}
 
 	return 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 08/15] signal/arm64: Only perform one esr_to_fault_info call in do_page_fault
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (7 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 07/15] signal/arm64: Expand __do_user_fault and remove it Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 09/15] signal/arm64: Only call set_thread_esr once " Eric W. Biederman
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

As this work is truly common between all of the signal sending cases
there is no need to repeat it between the different cases.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 7df3d8b561c2..ab85533e2255 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -424,6 +424,7 @@ static bool is_el0_instruction_abort(unsigned int esr)
 static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 				   struct pt_regs *regs)
 {
+	const struct fault_info *inf;
 	struct task_struct *tsk;
 	struct mm_struct *mm;
 	struct siginfo si;
@@ -562,6 +563,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		return 0;
 	}
 
+	inf = esr_to_fault_info(esr);
 	if (fault & VM_FAULT_SIGBUS) {
 		/*
 		 * We had some memory, but were unable to successfully fix up
@@ -572,7 +574,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= BUS_ADRERR;
 		si.si_addr = (void __user *)addr;
 		set_thread_esr(addr, esr);
-		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
+		arm64_force_sig_info(&si, inf->name);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
 
@@ -586,7 +588,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_addr = (void __user *)addr;
 		si.si_addr_lsb	= lsb;
 		set_thread_esr(addr, esr);
-		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
+		arm64_force_sig_info(&si, inf->name);
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
@@ -598,7 +600,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 				  SEGV_ACCERR : SEGV_MAPERR;
 		si.si_addr = (void __user *)addr;
 		set_thread_esr(addr, esr);
-		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
+		arm64_force_sig_info(&si, inf->name);
 	}
 
 	return 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 08/15] signal/arm64: Only perform one esr_to_fault_info call in do_page_fault
  2018-09-24  9:10 ` [REVIEW][PATCH 08/15] signal/arm64: Only perform one esr_to_fault_info call in do_page_fault Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

As this work is truly common between all of the signal sending cases
there is no need to repeat it between the different cases.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 7df3d8b561c2..ab85533e2255 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -424,6 +424,7 @@ static bool is_el0_instruction_abort(unsigned int esr)
 static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 				   struct pt_regs *regs)
 {
+	const struct fault_info *inf;
 	struct task_struct *tsk;
 	struct mm_struct *mm;
 	struct siginfo si;
@@ -562,6 +563,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		return 0;
 	}
 
+	inf = esr_to_fault_info(esr);
 	if (fault & VM_FAULT_SIGBUS) {
 		/*
 		 * We had some memory, but were unable to successfully fix up
@@ -572,7 +574,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= BUS_ADRERR;
 		si.si_addr = (void __user *)addr;
 		set_thread_esr(addr, esr);
-		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
+		arm64_force_sig_info(&si, inf->name);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
 
@@ -586,7 +588,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_addr = (void __user *)addr;
 		si.si_addr_lsb	= lsb;
 		set_thread_esr(addr, esr);
-		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
+		arm64_force_sig_info(&si, inf->name);
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
@@ -598,7 +600,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 				  SEGV_ACCERR : SEGV_MAPERR;
 		si.si_addr = (void __user *)addr;
 		set_thread_esr(addr, esr);
-		arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
+		arm64_force_sig_info(&si, inf->name);
 	}
 
 	return 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 09/15] signal/arm64: Only call set_thread_esr once in do_page_fault
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (8 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 08/15] signal/arm64: Only perform one esr_to_fault_info call in do_page_fault Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 10/15] signal/arm64: Add and use arm64_force_sig_fault where appropriate Eric W. Biederman
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

This code is truly common between the signal sending cases so share it.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index ab85533e2255..959c4a565c8e 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -564,6 +564,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 	}
 
 	inf = esr_to_fault_info(esr);
+	set_thread_esr(addr, esr);
 	if (fault & VM_FAULT_SIGBUS) {
 		/*
 		 * We had some memory, but were unable to successfully fix up
@@ -573,7 +574,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_ADRERR;
 		si.si_addr = (void __user *)addr;
-		set_thread_esr(addr, esr);
 		arm64_force_sig_info(&si, inf->name);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
@@ -587,7 +587,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= BUS_MCEERR_AR;
 		si.si_addr = (void __user *)addr;
 		si.si_addr_lsb	= lsb;
-		set_thread_esr(addr, esr);
 		arm64_force_sig_info(&si, inf->name);
 	} else {
 		/*
@@ -599,7 +598,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= fault == VM_FAULT_BADACCESS ?
 				  SEGV_ACCERR : SEGV_MAPERR;
 		si.si_addr = (void __user *)addr;
-		set_thread_esr(addr, esr);
 		arm64_force_sig_info(&si, inf->name);
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 09/15] signal/arm64: Only call set_thread_esr once in do_page_fault
  2018-09-24  9:10 ` [REVIEW][PATCH 09/15] signal/arm64: Only call set_thread_esr once " Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

This code is truly common between the signal sending cases so share it.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/arm64/mm/fault.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index ab85533e2255..959c4a565c8e 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -564,6 +564,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 	}
 
 	inf = esr_to_fault_info(esr);
+	set_thread_esr(addr, esr);
 	if (fault & VM_FAULT_SIGBUS) {
 		/*
 		 * We had some memory, but were unable to successfully fix up
@@ -573,7 +574,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_signo	= SIGBUS;
 		si.si_code	= BUS_ADRERR;
 		si.si_addr = (void __user *)addr;
-		set_thread_esr(addr, esr);
 		arm64_force_sig_info(&si, inf->name);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
@@ -587,7 +587,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= BUS_MCEERR_AR;
 		si.si_addr = (void __user *)addr;
 		si.si_addr_lsb	= lsb;
-		set_thread_esr(addr, esr);
 		arm64_force_sig_info(&si, inf->name);
 	} else {
 		/*
@@ -599,7 +598,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		si.si_code	= fault == VM_FAULT_BADACCESS ?
 				  SEGV_ACCERR : SEGV_MAPERR;
 		si.si_addr = (void __user *)addr;
-		set_thread_esr(addr, esr);
 		arm64_force_sig_info(&si, inf->name);
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 10/15] signal/arm64: Add and use arm64_force_sig_fault where appropriate
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (9 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 09/15] signal/arm64: Only call set_thread_esr once " Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 11/15] signal/arm64: Add and use arm64_force_sig_mceerr as appropriate Eric W. Biederman
                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Wrap force_sig_fault with a helper that calls arm64_show_signal
and call arm64_force_sig_fault where appropraite.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h     |  1 +
 arch/arm64/kernel/debug-monitors.c | 11 +++--------
 arch/arm64/kernel/ptrace.c         | 11 +++--------
 arch/arm64/kernel/traps.c          | 27 ++++++++++-----------------
 arch/arm64/mm/fault.c              | 26 ++++++++------------------
 5 files changed, 25 insertions(+), 51 deletions(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index cd3a2ca9c179..08e99901edbc 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -37,6 +37,7 @@ void register_undef_hook(struct undef_hook *hook);
 void unregister_undef_hook(struct undef_hook *hook);
 void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
+void arm64_force_sig_fault(int signo, int code, void __user *addr, const char *str);
 void arm64_force_sig_info(struct siginfo *info, const char *str);
 
 /*
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index e0d9502be5bf..d7bb6aefae0a 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -210,13 +210,6 @@ NOKPROBE_SYMBOL(call_step_hook);
 static void send_user_sigtrap(int si_code)
 {
 	struct pt_regs *regs = current_pt_regs();
-	siginfo_t info;
-
-	clear_siginfo(&info);
-	info.si_signo	= SIGTRAP;
-	info.si_errno	= 0;
-	info.si_code	= si_code;
-	info.si_addr	= (void __user *)instruction_pointer(regs);
 
 	if (WARN_ON(!user_mode(regs)))
 		return;
@@ -224,7 +217,9 @@ static void send_user_sigtrap(int si_code)
 	if (interrupts_enabled(regs))
 		local_irq_enable();
 
-	arm64_force_sig_info(&info, "User debug trap");
+	arm64_force_sig_fault(SIGTRAP, si_code,
+			     (void __user *)instruction_pointer(regs),
+			     "User debug trap");
 }
 
 static int single_step_handler(unsigned long addr, unsigned int esr,
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 20b68cb31ecb..7ab75e78aa08 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -182,13 +182,6 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 				struct pt_regs *regs)
 {
 	struct arch_hw_breakpoint *bkpt = counter_arch_bp(bp);
-	siginfo_t info;
-
-	clear_siginfo(&info);
-	info.si_signo	= SIGTRAP;
-	info.si_errno	= 0;
-	info.si_code	= TRAP_HWBKPT;
-	info.si_addr	= (void __user *)(bkpt->trigger);
 
 #ifdef CONFIG_COMPAT
 	if (is_compat_task()) {
@@ -211,7 +204,9 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 		force_sig_ptrace_errno_trap(si_errno, (void __user *)bkpt->trigger);
 	}
 #endif
-	arm64_force_sig_info(&info, "Hardware breakpoint trap (ptrace)");
+	arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,
+			      (void __user *)(bkpt->trigger),
+			      "Hardware breakpoint trap (ptrace)");
 }
 
 /*
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index daee8c2ca561..37a3309863e0 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -248,6 +248,13 @@ static void arm64_show_signal(int signo, const char *str)
 	__show_regs(regs);
 }
 
+void arm64_force_sig_fault(int signo, int code, void __user *addr,
+			   const char *str)
+{
+	arm64_show_signal(signo, str);
+	force_sig_fault(signo, code, addr, current);
+}
+
 void arm64_force_sig_info(struct siginfo *info, const char *str)
 {
 	arm64_show_signal(info->si_signo, str);
@@ -259,19 +266,11 @@ void arm64_notify_die(const char *str, struct pt_regs *regs,
 		      int err)
 {
 	if (user_mode(regs)) {
-		struct siginfo info;
-
 		WARN_ON(regs != current_pt_regs());
 		current->thread.fault_address = 0;
 		current->thread.fault_code = err;
 
-		clear_siginfo(&info);
-		info.si_signo = signo;
-		info.si_errno = 0;
-		info.si_code  = sicode;
-		info.si_addr  = addr;
-
-		arm64_force_sig_info(&info, str);
+		arm64_force_sig_fault(signo, sicode, addr, str);
 	} else {
 		die(str, regs, err);
 	}
@@ -616,19 +615,13 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
  */
 asmlinkage void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
 {
-	siginfo_t info;
 	void __user *pc = (void __user *)instruction_pointer(regs);
 
-	clear_siginfo(&info);
-	info.si_signo = SIGILL;
-	info.si_errno = 0;
-	info.si_code  = ILL_ILLOPC;
-	info.si_addr  = pc;
-
 	current->thread.fault_address = 0;
 	current->thread.fault_code = esr;
 
-	arm64_force_sig_info(&info, "Bad EL0 synchronous exception");
+	arm64_force_sig_fault(SIGILL, ILL_ILLOPC, pc,
+			      "Bad EL0 synchronous exception");
 }
 
 #ifdef CONFIG_VMAP_STACK
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 959c4a565c8e..66c295019a9a 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -362,15 +362,10 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
 	 */
 	if (user_mode(regs)) {
 		const struct fault_info *inf = esr_to_fault_info(esr);
-		struct siginfo si;
-
-		clear_siginfo(&si);
-		si.si_signo	= inf->sig;
-		si.si_code	= inf->code;
-		si.si_addr	= (void __user *)addr;
 
 		set_thread_esr(addr, esr);
-		arm64_force_sig_info(&si, inf->name);
+		arm64_force_sig_fault(inf->sig, inf->code, (void __user *)addr,
+				      inf->name);
 	} else {
 		__do_kernel_fault(addr, esr, regs);
 	}
@@ -570,11 +565,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		 * We had some memory, but were unable to successfully fix up
 		 * this page fault.
 		 */
-		clear_siginfo(&si);
-		si.si_signo	= SIGBUS;
-		si.si_code	= BUS_ADRERR;
-		si.si_addr = (void __user *)addr;
-		arm64_force_sig_info(&si, inf->name);
+		arm64_force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)addr,
+				      inf->name);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
 
@@ -593,12 +585,10 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		 * Something tried to access memory that isn't in our memory
 		 * map.
 		 */
-		clear_siginfo(&si);
-		si.si_signo	= SIGSEGV;
-		si.si_code	= fault == VM_FAULT_BADACCESS ?
-				  SEGV_ACCERR : SEGV_MAPERR;
-		si.si_addr = (void __user *)addr;
-		arm64_force_sig_info(&si, inf->name);
+		arm64_force_sig_fault(SIGSEGV,
+				      fault == VM_FAULT_BADACCESS ? SEGV_ACCERR : SEGV_MAPERR,
+				      (void __user *)addr,
+				      inf->name);
 	}
 
 	return 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 10/15] signal/arm64: Add and use arm64_force_sig_fault where appropriate
  2018-09-24  9:10 ` [REVIEW][PATCH 10/15] signal/arm64: Add and use arm64_force_sig_fault where appropriate Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Wrap force_sig_fault with a helper that calls arm64_show_signal
and call arm64_force_sig_fault where appropraite.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h     |  1 +
 arch/arm64/kernel/debug-monitors.c | 11 +++--------
 arch/arm64/kernel/ptrace.c         | 11 +++--------
 arch/arm64/kernel/traps.c          | 27 ++++++++++-----------------
 arch/arm64/mm/fault.c              | 26 ++++++++------------------
 5 files changed, 25 insertions(+), 51 deletions(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index cd3a2ca9c179..08e99901edbc 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -37,6 +37,7 @@ void register_undef_hook(struct undef_hook *hook);
 void unregister_undef_hook(struct undef_hook *hook);
 void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
+void arm64_force_sig_fault(int signo, int code, void __user *addr, const char *str);
 void arm64_force_sig_info(struct siginfo *info, const char *str);
 
 /*
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index e0d9502be5bf..d7bb6aefae0a 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -210,13 +210,6 @@ NOKPROBE_SYMBOL(call_step_hook);
 static void send_user_sigtrap(int si_code)
 {
 	struct pt_regs *regs = current_pt_regs();
-	siginfo_t info;
-
-	clear_siginfo(&info);
-	info.si_signo	= SIGTRAP;
-	info.si_errno	= 0;
-	info.si_code	= si_code;
-	info.si_addr	= (void __user *)instruction_pointer(regs);
 
 	if (WARN_ON(!user_mode(regs)))
 		return;
@@ -224,7 +217,9 @@ static void send_user_sigtrap(int si_code)
 	if (interrupts_enabled(regs))
 		local_irq_enable();
 
-	arm64_force_sig_info(&info, "User debug trap");
+	arm64_force_sig_fault(SIGTRAP, si_code,
+			     (void __user *)instruction_pointer(regs),
+			     "User debug trap");
 }
 
 static int single_step_handler(unsigned long addr, unsigned int esr,
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 20b68cb31ecb..7ab75e78aa08 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -182,13 +182,6 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 				struct pt_regs *regs)
 {
 	struct arch_hw_breakpoint *bkpt = counter_arch_bp(bp);
-	siginfo_t info;
-
-	clear_siginfo(&info);
-	info.si_signo	= SIGTRAP;
-	info.si_errno	= 0;
-	info.si_code	= TRAP_HWBKPT;
-	info.si_addr	= (void __user *)(bkpt->trigger);
 
 #ifdef CONFIG_COMPAT
 	if (is_compat_task()) {
@@ -211,7 +204,9 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 		force_sig_ptrace_errno_trap(si_errno, (void __user *)bkpt->trigger);
 	}
 #endif
-	arm64_force_sig_info(&info, "Hardware breakpoint trap (ptrace)");
+	arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,
+			      (void __user *)(bkpt->trigger),
+			      "Hardware breakpoint trap (ptrace)");
 }
 
 /*
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index daee8c2ca561..37a3309863e0 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -248,6 +248,13 @@ static void arm64_show_signal(int signo, const char *str)
 	__show_regs(regs);
 }
 
+void arm64_force_sig_fault(int signo, int code, void __user *addr,
+			   const char *str)
+{
+	arm64_show_signal(signo, str);
+	force_sig_fault(signo, code, addr, current);
+}
+
 void arm64_force_sig_info(struct siginfo *info, const char *str)
 {
 	arm64_show_signal(info->si_signo, str);
@@ -259,19 +266,11 @@ void arm64_notify_die(const char *str, struct pt_regs *regs,
 		      int err)
 {
 	if (user_mode(regs)) {
-		struct siginfo info;
-
 		WARN_ON(regs != current_pt_regs());
 		current->thread.fault_address = 0;
 		current->thread.fault_code = err;
 
-		clear_siginfo(&info);
-		info.si_signo = signo;
-		info.si_errno = 0;
-		info.si_code  = sicode;
-		info.si_addr  = addr;
-
-		arm64_force_sig_info(&info, str);
+		arm64_force_sig_fault(signo, sicode, addr, str);
 	} else {
 		die(str, regs, err);
 	}
@@ -616,19 +615,13 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
  */
 asmlinkage void bad_el0_sync(struct pt_regs *regs, int reason, unsigned int esr)
 {
-	siginfo_t info;
 	void __user *pc = (void __user *)instruction_pointer(regs);
 
-	clear_siginfo(&info);
-	info.si_signo = SIGILL;
-	info.si_errno = 0;
-	info.si_code  = ILL_ILLOPC;
-	info.si_addr  = pc;
-
 	current->thread.fault_address = 0;
 	current->thread.fault_code = esr;
 
-	arm64_force_sig_info(&info, "Bad EL0 synchronous exception");
+	arm64_force_sig_fault(SIGILL, ILL_ILLOPC, pc,
+			      "Bad EL0 synchronous exception");
 }
 
 #ifdef CONFIG_VMAP_STACK
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 959c4a565c8e..66c295019a9a 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -362,15 +362,10 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
 	 */
 	if (user_mode(regs)) {
 		const struct fault_info *inf = esr_to_fault_info(esr);
-		struct siginfo si;
-
-		clear_siginfo(&si);
-		si.si_signo	= inf->sig;
-		si.si_code	= inf->code;
-		si.si_addr	= (void __user *)addr;
 
 		set_thread_esr(addr, esr);
-		arm64_force_sig_info(&si, inf->name);
+		arm64_force_sig_fault(inf->sig, inf->code, (void __user *)addr,
+				      inf->name);
 	} else {
 		__do_kernel_fault(addr, esr, regs);
 	}
@@ -570,11 +565,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		 * We had some memory, but were unable to successfully fix up
 		 * this page fault.
 		 */
-		clear_siginfo(&si);
-		si.si_signo	= SIGBUS;
-		si.si_code	= BUS_ADRERR;
-		si.si_addr = (void __user *)addr;
-		arm64_force_sig_info(&si, inf->name);
+		arm64_force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)addr,
+				      inf->name);
 	} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
 		unsigned int lsb;
 
@@ -593,12 +585,10 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		 * Something tried to access memory that isn't in our memory
 		 * map.
 		 */
-		clear_siginfo(&si);
-		si.si_signo	= SIGSEGV;
-		si.si_code	= fault == VM_FAULT_BADACCESS ?
-				  SEGV_ACCERR : SEGV_MAPERR;
-		si.si_addr = (void __user *)addr;
-		arm64_force_sig_info(&si, inf->name);
+		arm64_force_sig_fault(SIGSEGV,
+				      fault == VM_FAULT_BADACCESS ? SEGV_ACCERR : SEGV_MAPERR,
+				      (void __user *)addr,
+				      inf->name);
 	}
 
 	return 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 11/15] signal/arm64: Add and use arm64_force_sig_mceerr as appropriate
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (10 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 10/15] signal/arm64: Add and use arm64_force_sig_fault where appropriate Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 12/15] signal/arm64: Remove arm64_force_sig_info Eric W. Biederman
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Add arm64_force_sig_mceerr for consistency with arm64_force_sig_fault,
and use it in the one location that can take advantage of it.

This removes the fiddly filling out of siginfo before sending a signal
reporting an memory error to userspace.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h | 1 +
 arch/arm64/kernel/traps.c      | 7 +++++++
 arch/arm64/mm/fault.c          | 9 ++-------
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index 08e99901edbc..193f0b0e8ee3 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -38,6 +38,7 @@ void unregister_undef_hook(struct undef_hook *hook);
 void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
 void arm64_force_sig_fault(int signo, int code, void __user *addr, const char *str);
+void arm64_force_sig_mceerr(int code, void __user *addr, short lsb, const char *str);
 void arm64_force_sig_info(struct siginfo *info, const char *str);
 
 /*
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 37a3309863e0..baa96dfffeec 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -255,6 +255,13 @@ void arm64_force_sig_fault(int signo, int code, void __user *addr,
 	force_sig_fault(signo, code, addr, current);
 }
 
+void arm64_force_sig_mceerr(int code, void __user *addr, short lsb,
+			    const char *str)
+{
+	arm64_show_signal(SIGBUS, str);
+	force_sig_mceerr(code, addr, lsb, current);
+}
+
 void arm64_force_sig_info(struct siginfo *info, const char *str)
 {
 	arm64_show_signal(info->si_signo, str);
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 66c295019a9a..f0ccb209d181 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -422,7 +422,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 	const struct fault_info *inf;
 	struct task_struct *tsk;
 	struct mm_struct *mm;
-	struct siginfo si;
 	vm_fault_t fault, major = 0;
 	unsigned long vm_flags = VM_READ | VM_WRITE;
 	unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
@@ -574,12 +573,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		if (fault & VM_FAULT_HWPOISON_LARGE)
 			lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
 
-		clear_siginfo(&si);
-		si.si_signo	= SIGBUS;
-		si.si_code	= BUS_MCEERR_AR;
-		si.si_addr = (void __user *)addr;
-		si.si_addr_lsb	= lsb;
-		arm64_force_sig_info(&si, inf->name);
+		arm64_force_sig_mceerr(BUS_MCEERR_AR, (void __user *)addr, lsb,
+				       inf->name);
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 11/15] signal/arm64: Add and use arm64_force_sig_mceerr as appropriate
  2018-09-24  9:10 ` [REVIEW][PATCH 11/15] signal/arm64: Add and use arm64_force_sig_mceerr as appropriate Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Add arm64_force_sig_mceerr for consistency with arm64_force_sig_fault,
and use it in the one location that can take advantage of it.

This removes the fiddly filling out of siginfo before sending a signal
reporting an memory error to userspace.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h | 1 +
 arch/arm64/kernel/traps.c      | 7 +++++++
 arch/arm64/mm/fault.c          | 9 ++-------
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index 08e99901edbc..193f0b0e8ee3 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -38,6 +38,7 @@ void unregister_undef_hook(struct undef_hook *hook);
 void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
 void arm64_force_sig_fault(int signo, int code, void __user *addr, const char *str);
+void arm64_force_sig_mceerr(int code, void __user *addr, short lsb, const char *str);
 void arm64_force_sig_info(struct siginfo *info, const char *str);
 
 /*
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 37a3309863e0..baa96dfffeec 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -255,6 +255,13 @@ void arm64_force_sig_fault(int signo, int code, void __user *addr,
 	force_sig_fault(signo, code, addr, current);
 }
 
+void arm64_force_sig_mceerr(int code, void __user *addr, short lsb,
+			    const char *str)
+{
+	arm64_show_signal(SIGBUS, str);
+	force_sig_mceerr(code, addr, lsb, current);
+}
+
 void arm64_force_sig_info(struct siginfo *info, const char *str)
 {
 	arm64_show_signal(info->si_signo, str);
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 66c295019a9a..f0ccb209d181 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -422,7 +422,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 	const struct fault_info *inf;
 	struct task_struct *tsk;
 	struct mm_struct *mm;
-	struct siginfo si;
 	vm_fault_t fault, major = 0;
 	unsigned long vm_flags = VM_READ | VM_WRITE;
 	unsigned int mm_flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
@@ -574,12 +573,8 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
 		if (fault & VM_FAULT_HWPOISON_LARGE)
 			lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
 
-		clear_siginfo(&si);
-		si.si_signo	= SIGBUS;
-		si.si_code	= BUS_MCEERR_AR;
-		si.si_addr = (void __user *)addr;
-		si.si_addr_lsb	= lsb;
-		arm64_force_sig_info(&si, inf->name);
+		arm64_force_sig_mceerr(BUS_MCEERR_AR, (void __user *)addr, lsb,
+				       inf->name);
 	} else {
 		/*
 		 * Something tried to access memory that isn't in our memory
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 12/15] signal/arm64: Remove arm64_force_sig_info
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (11 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 11/15] signal/arm64: Add and use arm64_force_sig_mceerr as appropriate Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 13/15] signal/arm64: In ptrace_hbptriggered name the signal description string Eric W. Biederman
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

The function has no more callers so remove it.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h | 1 -
 arch/arm64/kernel/traps.c      | 6 ------
 2 files changed, 7 deletions(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index 193f0b0e8ee3..d32b8bd440af 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -39,7 +39,6 @@ void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
 void arm64_force_sig_fault(int signo, int code, void __user *addr, const char *str);
 void arm64_force_sig_mceerr(int code, void __user *addr, short lsb, const char *str);
-void arm64_force_sig_info(struct siginfo *info, const char *str);
 
 /*
  * Move regs->pc to next instruction and do necessary setup before it
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index baa96dfffeec..de67818258cd 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -262,12 +262,6 @@ void arm64_force_sig_mceerr(int code, void __user *addr, short lsb,
 	force_sig_mceerr(code, addr, lsb, current);
 }
 
-void arm64_force_sig_info(struct siginfo *info, const char *str)
-{
-	arm64_show_signal(info->si_signo, str);
-	force_sig_info(info->si_signo, info, current);
-}
-
 void arm64_notify_die(const char *str, struct pt_regs *regs,
 		      int signo, int sicode, void __user *addr,
 		      int err)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 12/15] signal/arm64: Remove arm64_force_sig_info
  2018-09-24  9:10 ` [REVIEW][PATCH 12/15] signal/arm64: Remove arm64_force_sig_info Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

The function has no more callers so remove it.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h | 1 -
 arch/arm64/kernel/traps.c      | 6 ------
 2 files changed, 7 deletions(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index 193f0b0e8ee3..d32b8bd440af 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -39,7 +39,6 @@ void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
 void arm64_force_sig_fault(int signo, int code, void __user *addr, const char *str);
 void arm64_force_sig_mceerr(int code, void __user *addr, short lsb, const char *str);
-void arm64_force_sig_info(struct siginfo *info, const char *str);
 
 /*
  * Move regs->pc to next instruction and do necessary setup before it
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index baa96dfffeec..de67818258cd 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -262,12 +262,6 @@ void arm64_force_sig_mceerr(int code, void __user *addr, short lsb,
 	force_sig_mceerr(code, addr, lsb, current);
 }
 
-void arm64_force_sig_info(struct siginfo *info, const char *str)
-{
-	arm64_show_signal(info->si_signo, str);
-	force_sig_info(info->si_signo, info, current);
-}
-
 void arm64_notify_die(const char *str, struct pt_regs *regs,
 		      int signo, int sicode, void __user *addr,
 		      int err)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 13/15] signal/arm64: In ptrace_hbptriggered name the signal description string
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (12 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 12/15] signal/arm64: Remove arm64_force_sig_info Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 14/15] signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap Eric W. Biederman
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

This will let the description be reused shortly.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/kernel/ptrace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 7ab75e78aa08..921267f59d0d 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -182,6 +182,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 				struct pt_regs *regs)
 {
 	struct arch_hw_breakpoint *bkpt = counter_arch_bp(bp);
+	const char *desc = "Hardware breakpoint trap (ptrace)";
 
 #ifdef CONFIG_COMPAT
 	if (is_compat_task()) {
@@ -206,7 +207,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 #endif
 	arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,
 			      (void __user *)(bkpt->trigger),
-			      "Hardware breakpoint trap (ptrace)");
+			      desc);
 }
 
 /*
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 13/15] signal/arm64: In ptrace_hbptriggered name the signal description string
  2018-09-24  9:10 ` [REVIEW][PATCH 13/15] signal/arm64: In ptrace_hbptriggered name the signal description string Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

This will let the description be reused shortly.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/kernel/ptrace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 7ab75e78aa08..921267f59d0d 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -182,6 +182,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 				struct pt_regs *regs)
 {
 	struct arch_hw_breakpoint *bkpt = counter_arch_bp(bp);
+	const char *desc = "Hardware breakpoint trap (ptrace)";
 
 #ifdef CONFIG_COMPAT
 	if (is_compat_task()) {
@@ -206,7 +207,7 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 #endif
 	arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,
 			      (void __user *)(bkpt->trigger),
-			      "Hardware breakpoint trap (ptrace)");
+			      desc);
 }
 
 /*
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 14/15] signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (13 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 13/15] signal/arm64: In ptrace_hbptriggered name the signal description string Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-24  9:10 ` [REVIEW][PATCH 15/15] signal/arm64: Use send_sig_fault where appropriate Eric W. Biederman
  2018-09-26 17:38 ` [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Catalin Marinas
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Add arm64_force_sig_ptrace_errno_trap for consistency with
arm64_force_sig_fault and use it where appropriate.

This adds the show_signal logic to the force_sig_errno_trap case,
where it was apparently overlooked earlier.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h | 1 +
 arch/arm64/kernel/ptrace.c     | 4 +++-
 arch/arm64/kernel/traps.c      | 7 +++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index d32b8bd440af..f9c1aa6167d2 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -39,6 +39,7 @@ void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
 void arm64_force_sig_fault(int signo, int code, void __user *addr, const char *str);
 void arm64_force_sig_mceerr(int code, void __user *addr, short lsb, const char *str);
+void arm64_force_sig_ptrace_errno_trap(int errno, void __user *addr, const char *str);
 
 /*
  * Move regs->pc to next instruction and do necessary setup before it
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 921267f59d0d..1710a2d01669 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -202,7 +202,9 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 				break;
 			}
 		}
-		force_sig_ptrace_errno_trap(si_errno, (void __user *)bkpt->trigger);
+		arm64_force_sig_ptrace_errno_trap(si_errno,
+						  (void __user *)bkpt->trigger,
+						  desc);
 	}
 #endif
 	arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index de67818258cd..856b32aa03d8 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -262,6 +262,13 @@ void arm64_force_sig_mceerr(int code, void __user *addr, short lsb,
 	force_sig_mceerr(code, addr, lsb, current);
 }
 
+void arm64_force_sig_ptrace_errno_trap(int errno, void __user *addr,
+				       const char *str)
+{
+	arm64_show_signal(SIGTRAP, str);
+	force_sig_ptrace_errno_trap(errno, addr);
+}
+
 void arm64_notify_die(const char *str, struct pt_regs *regs,
 		      int signo, int sicode, void __user *addr,
 		      int err)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 14/15] signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap
  2018-09-24  9:10 ` [REVIEW][PATCH 14/15] signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Add arm64_force_sig_ptrace_errno_trap for consistency with
arm64_force_sig_fault and use it where appropriate.

This adds the show_signal logic to the force_sig_errno_trap case,
where it was apparently overlooked earlier.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/include/asm/traps.h | 1 +
 arch/arm64/kernel/ptrace.c     | 4 +++-
 arch/arm64/kernel/traps.c      | 7 +++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
index d32b8bd440af..f9c1aa6167d2 100644
--- a/arch/arm64/include/asm/traps.h
+++ b/arch/arm64/include/asm/traps.h
@@ -39,6 +39,7 @@ void force_signal_inject(int signal, int code, unsigned long address);
 void arm64_notify_segfault(unsigned long addr);
 void arm64_force_sig_fault(int signo, int code, void __user *addr, const char *str);
 void arm64_force_sig_mceerr(int code, void __user *addr, short lsb, const char *str);
+void arm64_force_sig_ptrace_errno_trap(int errno, void __user *addr, const char *str);
 
 /*
  * Move regs->pc to next instruction and do necessary setup before it
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 921267f59d0d..1710a2d01669 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -202,7 +202,9 @@ static void ptrace_hbptriggered(struct perf_event *bp,
 				break;
 			}
 		}
-		force_sig_ptrace_errno_trap(si_errno, (void __user *)bkpt->trigger);
+		arm64_force_sig_ptrace_errno_trap(si_errno,
+						  (void __user *)bkpt->trigger,
+						  desc);
 	}
 #endif
 	arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT,
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index de67818258cd..856b32aa03d8 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -262,6 +262,13 @@ void arm64_force_sig_mceerr(int code, void __user *addr, short lsb,
 	force_sig_mceerr(code, addr, lsb, current);
 }
 
+void arm64_force_sig_ptrace_errno_trap(int errno, void __user *addr,
+				       const char *str)
+{
+	arm64_show_signal(SIGTRAP, str);
+	force_sig_ptrace_errno_trap(errno, addr);
+}
+
 void arm64_notify_die(const char *str, struct pt_regs *regs,
 		      int signo, int sicode, void __user *addr,
 		      int err)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 15/15] signal/arm64: Use send_sig_fault where appropriate
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (14 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 14/15] signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap Eric W. Biederman
@ 2018-09-24  9:10 ` Eric W. Biederman
  2018-09-24  9:10   ` Eric W. Biederman
  2018-09-26 17:38 ` [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Catalin Marinas
  16 siblings, 1 reply; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/kernel/fpsimd.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 58c53bc96928..5ebe73b69961 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -842,7 +842,6 @@ asmlinkage void do_fpsimd_acc(unsigned int esr, struct pt_regs *regs)
  */
 asmlinkage void do_fpsimd_exc(unsigned int esr, struct pt_regs *regs)
 {
-	siginfo_t info;
 	unsigned int si_code = FPE_FLTUNK;
 
 	if (esr & ESR_ELx_FP_EXC_TFV) {
@@ -858,12 +857,9 @@ asmlinkage void do_fpsimd_exc(unsigned int esr, struct pt_regs *regs)
 			si_code = FPE_FLTRES;
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = SIGFPE;
-	info.si_code = si_code;
-	info.si_addr = (void __user *)instruction_pointer(regs);
-
-	send_sig_info(SIGFPE, &info, current);
+	send_sig_fault(SIGFPE, si_code,
+		       (void __user *)instruction_pointer(regs),
+		       current);
 }
 
 void fpsimd_thread_switch(struct task_struct *next)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [REVIEW][PATCH 15/15] signal/arm64: Use send_sig_fault where appropriate
  2018-09-24  9:10 ` [REVIEW][PATCH 15/15] signal/arm64: Use send_sig_fault where appropriate Eric W. Biederman
@ 2018-09-24  9:10   ` Eric W. Biederman
  0 siblings, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-24  9:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Catalin Marinas, Will Deacon, linux-arm-kernel,
	Eric W. Biederman

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/arm64/kernel/fpsimd.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 58c53bc96928..5ebe73b69961 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -842,7 +842,6 @@ asmlinkage void do_fpsimd_acc(unsigned int esr, struct pt_regs *regs)
  */
 asmlinkage void do_fpsimd_exc(unsigned int esr, struct pt_regs *regs)
 {
-	siginfo_t info;
 	unsigned int si_code = FPE_FLTUNK;
 
 	if (esr & ESR_ELx_FP_EXC_TFV) {
@@ -858,12 +857,9 @@ asmlinkage void do_fpsimd_exc(unsigned int esr, struct pt_regs *regs)
 			si_code = FPE_FLTRES;
 	}
 
-	clear_siginfo(&info);
-	info.si_signo = SIGFPE;
-	info.si_code = si_code;
-	info.si_addr = (void __user *)instruction_pointer(regs);
-
-	send_sig_info(SIGFPE, &info, current);
+	send_sig_fault(SIGFPE, si_code,
+		       (void __user *)instruction_pointer(regs),
+		       current);
 }
 
 void fpsimd_thread_switch(struct task_struct *next)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups
  2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
                   ` (15 preceding siblings ...)
  2018-09-24  9:10 ` [REVIEW][PATCH 15/15] signal/arm64: Use send_sig_fault where appropriate Eric W. Biederman
@ 2018-09-26 17:38 ` Catalin Marinas
  2018-09-26 17:38   ` Catalin Marinas
  2018-09-27  9:39   ` Eric W. Biederman
  16 siblings, 2 replies; 38+ messages in thread
From: Catalin Marinas @ 2018-09-26 17:38 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-kernel, linux-arch, Will Deacon, linux-arm-kernel

Hi Eric,

On Mon, Sep 24, 2018 at 11:07:05AM +0200, Eric W. Biederman wrote:
> This is the continuation of my work to sort out signaling of exceptions
> with siginfo.  The old signal sending functions by taking a siginfo
> argument resulted in their callers having to deal with the fiddly nature
> of siginfo directly.  In small numbers of callers this is not a problem
> but in the number of callers in the kernel this resulted in cases
> where fields were not initialized or improperly initialized before
> being passed to userspace.
> 
> To avoid having to worry about those issues I have added new signal
> sending functions that each deal wit a different siginfo case.  When
> using these functions there is no room for the fiddly nature of siginfo
> to cause mistakes.
> 
> This is my set of changes to update arm64 to use those functions.
> Along with some refactoring so those functions can be cleanly used.
> 
> Folks please review and double check me.  I think I have kept these
> changes simple and obviously correct but I am human and mess up
> sometimes.

Nice clean-up, thanks. I started reviewing the patches, I should finish
by tomorrow (I also applied them locally to give some testing).

> After these patches have had a chance to be reviewed I plan to merge
> them by my siginfo tree.  If you would rather take them in the arm64
> tree let me know.   All of the prerequisites should have been merged
> through Linus's tree several releases ago.

Either way works for me. There is a trivial conflict in
force_signal_inject() with the arm64 for-next/core tree so I could as
well put them on top of this branch and send them during the 4.20
merging window.

-- 
Catalin

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups
  2018-09-26 17:38 ` [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Catalin Marinas
@ 2018-09-26 17:38   ` Catalin Marinas
  2018-09-27  9:39   ` Eric W. Biederman
  1 sibling, 0 replies; 38+ messages in thread
From: Catalin Marinas @ 2018-09-26 17:38 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-kernel, linux-arch, Will Deacon, linux-arm-kernel

Hi Eric,

On Mon, Sep 24, 2018 at 11:07:05AM +0200, Eric W. Biederman wrote:
> This is the continuation of my work to sort out signaling of exceptions
> with siginfo.  The old signal sending functions by taking a siginfo
> argument resulted in their callers having to deal with the fiddly nature
> of siginfo directly.  In small numbers of callers this is not a problem
> but in the number of callers in the kernel this resulted in cases
> where fields were not initialized or improperly initialized before
> being passed to userspace.
> 
> To avoid having to worry about those issues I have added new signal
> sending functions that each deal wit a different siginfo case.  When
> using these functions there is no room for the fiddly nature of siginfo
> to cause mistakes.
> 
> This is my set of changes to update arm64 to use those functions.
> Along with some refactoring so those functions can be cleanly used.
> 
> Folks please review and double check me.  I think I have kept these
> changes simple and obviously correct but I am human and mess up
> sometimes.

Nice clean-up, thanks. I started reviewing the patches, I should finish
by tomorrow (I also applied them locally to give some testing).

> After these patches have had a chance to be reviewed I plan to merge
> them by my siginfo tree.  If you would rather take them in the arm64
> tree let me know.   All of the prerequisites should have been merged
> through Linus's tree several releases ago.

Either way works for me. There is a trivial conflict in
force_signal_inject() with the arm64 for-next/core tree so I could as
well put them on top of this branch and send them during the 4.20
merging window.

-- 
Catalin

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups
  2018-09-26 17:38 ` [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Catalin Marinas
  2018-09-26 17:38   ` Catalin Marinas
@ 2018-09-27  9:39   ` Eric W. Biederman
  2018-09-27  9:39     ` Eric W. Biederman
  2018-09-27 13:50     ` Catalin Marinas
  1 sibling, 2 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-27  9:39 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: linux-kernel, linux-arch, Will Deacon, linux-arm-kernel

Catalin Marinas <catalin.marinas@arm.com> writes:

> Hi Eric,
>
> On Mon, Sep 24, 2018 at 11:07:05AM +0200, Eric W. Biederman wrote:
>> This is the continuation of my work to sort out signaling of exceptions
>> with siginfo.  The old signal sending functions by taking a siginfo
>> argument resulted in their callers having to deal with the fiddly nature
>> of siginfo directly.  In small numbers of callers this is not a problem
>> but in the number of callers in the kernel this resulted in cases
>> where fields were not initialized or improperly initialized before
>> being passed to userspace.
>> 
>> To avoid having to worry about those issues I have added new signal
>> sending functions that each deal wit a different siginfo case.  When
>> using these functions there is no room for the fiddly nature of siginfo
>> to cause mistakes.
>> 
>> This is my set of changes to update arm64 to use those functions.
>> Along with some refactoring so those functions can be cleanly used.
>> 
>> Folks please review and double check me.  I think I have kept these
>> changes simple and obviously correct but I am human and mess up
>> sometimes.
>
> Nice clean-up, thanks. I started reviewing the patches, I should finish
> by tomorrow (I also applied them locally to give some testing).
>
>> After these patches have had a chance to be reviewed I plan to merge
>> them by my siginfo tree.  If you would rather take them in the arm64
>> tree let me know.   All of the prerequisites should have been merged
>> through Linus's tree several releases ago.
>
> Either way works for me. There is a trivial conflict in
> force_signal_inject() with the arm64 for-next/core tree so I could as
> well put them on top of this branch and send them during the 4.20
> merging window.

As long as there is a trivial conflict I would like to keep everything
in one tree.

There is a following patchset that manages to reduce the size of struct
siginfo in the kernel that I have also posted for review.    With
everything in one tree I can make that change now, and just cross it off
my list of things to worry about.

Eric

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups
  2018-09-27  9:39   ` Eric W. Biederman
@ 2018-09-27  9:39     ` Eric W. Biederman
  2018-09-27 13:50     ` Catalin Marinas
  1 sibling, 0 replies; 38+ messages in thread
From: Eric W. Biederman @ 2018-09-27  9:39 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: linux-kernel, linux-arch, Will Deacon, linux-arm-kernel

Catalin Marinas <catalin.marinas@arm.com> writes:

> Hi Eric,
>
> On Mon, Sep 24, 2018 at 11:07:05AM +0200, Eric W. Biederman wrote:
>> This is the continuation of my work to sort out signaling of exceptions
>> with siginfo.  The old signal sending functions by taking a siginfo
>> argument resulted in their callers having to deal with the fiddly nature
>> of siginfo directly.  In small numbers of callers this is not a problem
>> but in the number of callers in the kernel this resulted in cases
>> where fields were not initialized or improperly initialized before
>> being passed to userspace.
>> 
>> To avoid having to worry about those issues I have added new signal
>> sending functions that each deal wit a different siginfo case.  When
>> using these functions there is no room for the fiddly nature of siginfo
>> to cause mistakes.
>> 
>> This is my set of changes to update arm64 to use those functions.
>> Along with some refactoring so those functions can be cleanly used.
>> 
>> Folks please review and double check me.  I think I have kept these
>> changes simple and obviously correct but I am human and mess up
>> sometimes.
>
> Nice clean-up, thanks. I started reviewing the patches, I should finish
> by tomorrow (I also applied them locally to give some testing).
>
>> After these patches have had a chance to be reviewed I plan to merge
>> them by my siginfo tree.  If you would rather take them in the arm64
>> tree let me know.   All of the prerequisites should have been merged
>> through Linus's tree several releases ago.
>
> Either way works for me. There is a trivial conflict in
> force_signal_inject() with the arm64 for-next/core tree so I could as
> well put them on top of this branch and send them during the 4.20
> merging window.

As long as there is a trivial conflict I would like to keep everything
in one tree.

There is a following patchset that manages to reduce the size of struct
siginfo in the kernel that I have also posted for review.    With
everything in one tree I can make that change now, and just cross it off
my list of things to worry about.

Eric

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups
  2018-09-27  9:39   ` Eric W. Biederman
  2018-09-27  9:39     ` Eric W. Biederman
@ 2018-09-27 13:50     ` Catalin Marinas
  2018-09-27 13:50       ` Catalin Marinas
  1 sibling, 1 reply; 38+ messages in thread
From: Catalin Marinas @ 2018-09-27 13:50 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-arch, Will Deacon, linux-kernel, linux-arm-kernel

On Thu, Sep 27, 2018 at 11:39:35AM +0200, Eric W. Biederman wrote:
> Catalin Marinas <catalin.marinas@arm.com> writes:
> > On Mon, Sep 24, 2018 at 11:07:05AM +0200, Eric W. Biederman wrote:
> >> After these patches have had a chance to be reviewed I plan to merge
> >> them by my siginfo tree.  If you would rather take them in the arm64
> >> tree let me know.   All of the prerequisites should have been merged
> >> through Linus's tree several releases ago.
> >
> > Either way works for me. There is a trivial conflict in
> > force_signal_inject() with the arm64 for-next/core tree so I could as
> > well put them on top of this branch and send them during the 4.20
> > merging window.
> 
> As long as there is a trivial conflict I would like to keep everything
> in one tree.
> 
> There is a following patchset that manages to reduce the size of struct
> siginfo in the kernel that I have also posted for review.    With
> everything in one tree I can make that change now, and just cross it off
> my list of things to worry about.

Fine by me:

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>

The conflict will appear in -next but the resolution is simple:

diff --cc arch/arm64/kernel/traps.c
index 21689c6a985f,856b32aa03d8..adb0a32c1568
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@@ -353,12 -366,6 +368,9 @@@ void force_signal_inject(int signal, in
  	const char *desc;
  	struct pt_regs *regs = current_pt_regs();
  
 +	if (WARN_ON(!user_mode(regs)))
 +		return;
 +
- 	clear_siginfo(&info);
- 
  	switch (signal) {
  	case SIGILL:
  		desc = "undefined instruction";

-- 
Catalin

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups
  2018-09-27 13:50     ` Catalin Marinas
@ 2018-09-27 13:50       ` Catalin Marinas
  0 siblings, 0 replies; 38+ messages in thread
From: Catalin Marinas @ 2018-09-27 13:50 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-arch, Will Deacon, linux-kernel, linux-arm-kernel

On Thu, Sep 27, 2018 at 11:39:35AM +0200, Eric W. Biederman wrote:
> Catalin Marinas <catalin.marinas@arm.com> writes:
> > On Mon, Sep 24, 2018 at 11:07:05AM +0200, Eric W. Biederman wrote:
> >> After these patches have had a chance to be reviewed I plan to merge
> >> them by my siginfo tree.  If you would rather take them in the arm64
> >> tree let me know.   All of the prerequisites should have been merged
> >> through Linus's tree several releases ago.
> >
> > Either way works for me. There is a trivial conflict in
> > force_signal_inject() with the arm64 for-next/core tree so I could as
> > well put them on top of this branch and send them during the 4.20
> > merging window.
> 
> As long as there is a trivial conflict I would like to keep everything
> in one tree.
> 
> There is a following patchset that manages to reduce the size of struct
> siginfo in the kernel that I have also posted for review.    With
> everything in one tree I can make that change now, and just cross it off
> my list of things to worry about.

Fine by me:

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>

The conflict will appear in -next but the resolution is simple:

diff --cc arch/arm64/kernel/traps.c
index 21689c6a985f,856b32aa03d8..adb0a32c1568
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@@ -353,12 -366,6 +368,9 @@@ void force_signal_inject(int signal, in
  	const char *desc;
  	struct pt_regs *regs = current_pt_regs();
  
 +	if (WARN_ON(!user_mode(regs)))
 +		return;
 +
- 	clear_siginfo(&info);
- 
  	switch (signal) {
  	case SIGILL:
  		desc = "undefined instruction";

-- 
Catalin

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2018-09-27 20:08 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24  9:07 [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Eric W. Biederman
2018-09-24  9:07 ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 01/15] signal/arm64: Push siginfo generation into arm64_notify_die Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 02/15] signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 03/15] signal/arm64: Factor out arm64_show_signal " Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 04/15] signal/arm64: Factor set_thread_esr out of __do_user_fault Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 05/15] signal/arm64: Consolidate the two hwpoison cases in do_page_fault Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 06/15] signal/arm64: For clarity separate the 3 signal sending " Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 07/15] signal/arm64: Expand __do_user_fault and remove it Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 08/15] signal/arm64: Only perform one esr_to_fault_info call in do_page_fault Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 09/15] signal/arm64: Only call set_thread_esr once " Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 10/15] signal/arm64: Add and use arm64_force_sig_fault where appropriate Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 11/15] signal/arm64: Add and use arm64_force_sig_mceerr as appropriate Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 12/15] signal/arm64: Remove arm64_force_sig_info Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 13/15] signal/arm64: In ptrace_hbptriggered name the signal description string Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 14/15] signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-24  9:10 ` [REVIEW][PATCH 15/15] signal/arm64: Use send_sig_fault where appropriate Eric W. Biederman
2018-09-24  9:10   ` Eric W. Biederman
2018-09-26 17:38 ` [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups Catalin Marinas
2018-09-26 17:38   ` Catalin Marinas
2018-09-27  9:39   ` Eric W. Biederman
2018-09-27  9:39     ` Eric W. Biederman
2018-09-27 13:50     ` Catalin Marinas
2018-09-27 13:50       ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).