stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REVIEW][PATCH 00/22] Simplifying siginfo users
       [not found] <878t9ilmhv.fsf@xmission.com>
@ 2018-04-20 14:35 ` Eric W. Biederman
  2018-04-20 14:38   ` [REVIEW][PATCH 21/22] signal/xtensa: Consistenly use SIGBUS in do_unaligned_user Eric W. Biederman
  0 siblings, 1 reply; 3+ messages in thread
From: Eric W. Biederman @ 2018-04-20 14:35 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Albert Ou, Aurelien Jacquiot, Chris Zankel,
	David Miller, Geert Uytterhoeven, Greentime Hu, Heiko Carstens,
	Helge Deller, Ivan Kokshaysky, James Bottomley, James Hogan,
	Jeff Dike, Jonas Bonn, Ley Foon Tan, Mark Salter,
	Martin Schwidefsky, Max Filippov, Michal Simek, nios2-dev,
	openrisc, Palmer Dabbelt, Ralf Baechle, Richard Henderson,
	Richard Kuo, Richard Weinberger, Rich Felker, sparclinux, stable,
	Stafford Horne, Stefan Kristiansson, user-mode-linux-devel,
	Vincent Chen, Yoshinori Sato


This patchset is almost completely updating the various pieces of
architecture code from filling out a struct siginfo and then calling
force_sig_info.  To using the helper force_sig_fault instead.  Which
takes the values that would have gone in siginfo as arguments.

As the diffstat below shows this noticeable reduces the amount of code.

There are a couple of minor and straight forward bug fixes as well
that I came across while working on the aforementioned changes.

This applies on my last round of siginfo changes simply to remove the
possibility of conflicts.  The changes should be semantically separate.

I intend to merge these changes through my siginfo tree.  If you have
any objections or would prefer to carry these changes in your
architecture trees please let me know.

The changes are also available at:
  git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git siginfo-review2

Eric W. Biederman (22):
      signal/alpha: Use send_sig_fault where appropriate
      signal/alpha: Use force_sig_fault where appropriate
      signal/c6x: Use force_sig_fault where appropriate
      signal/hexagon: Use force_sig_fault as appropriate
      signal/m68k: Use force_sig_fault where appropriate
      signal/microblaze: Remove the commented out force_sig_info in do_page_fault
      signal/microblaze: Use force_sig_fault where appropriate
      signal/mips: Use force_sig_fault where appropriate
      signal/nds32: Use force_sig_fault where appropriate
      signal/nios2: Use force_sig_fault where appropriate
      signal/openrisc: Use force_sig_fault where appropriate
      signal/parisc: Use force_sig_mceerr where appropriate
      signal/parisc: Use force_sig_fault where appropriate
      signal/riscv: Use force_sig_fault where appropriate
      signal/s390: Use force_sig_fault where appropriate
      signal/sh: Use force_sig_fault where appropriate
      signal/sparc: Use send_sig_fault where appropriate
      signal/sparc: Use force_sig_fault where appropriate
      signal/um: Use force_sig_fault in relay_signal.
      signal/um: Use force_sig_fault where appropriate
      signal/xtensa: Consistenly use SIGBUS in do_unaligned_user
      signal/xtensa: Use force_sig_fault where appropriate

 arch/alpha/kernel/osf_sys.c         |  10 +--
 arch/alpha/kernel/signal.c          |  22 +-----
 arch/alpha/kernel/traps.c           |  80 +++++---------------
 arch/alpha/mm/fault.c               |  15 +---
 arch/c6x/kernel/traps.c             |  10 +--
 arch/hexagon/kernel/traps.c         |  10 +--
 arch/hexagon/mm/vm_fault.c          |  21 ++----
 arch/m68k/kernel/traps.c            |  60 +++++++--------
 arch/m68k/mm/fault.c                |  25 +++----
 arch/microblaze/kernel/exceptions.c |   9 +--
 arch/microblaze/mm/fault.c          |  14 +---
 arch/mips/kernel/traps.c            |  65 +++++-----------
 arch/mips/mm/fault.c                |  19 ++---
 arch/nds32/kernel/traps.c           |  20 +----
 arch/nds32/mm/fault.c               |  19 ++---
 arch/nios2/kernel/traps.c           |   9 +--
 arch/openrisc/kernel/traps.c        |  33 +-------
 arch/openrisc/mm/fault.c            |  19 ++---
 arch/parisc/kernel/ptrace.c         |  11 +--
 arch/parisc/kernel/traps.c          |  63 +++++-----------
 arch/parisc/kernel/unaligned.c      |  16 +---
 arch/parisc/math-emu/driver.c       |   9 +--
 arch/parisc/mm/fault.c              |  55 +++++++-------
 arch/riscv/kernel/traps.c           |   9 +--
 arch/s390/kernel/traps.c            |  32 ++------
 arch/s390/mm/fault.c                |  23 ++----
 arch/sh/kernel/traps_32.c           |  19 ++---
 arch/sh/math-emu/math.c             |   9 +--
 arch/sh/mm/fault.c                  |  10 +--
 arch/sparc/kernel/process_64.c      |  10 +--
 arch/sparc/kernel/sys_sparc_32.c    |   9 +--
 arch/sparc/kernel/sys_sparc_64.c    |   8 +-
 arch/sparc/kernel/traps_32.c        | 114 +++++-----------------------
 arch/sparc/kernel/traps_64.c        | 145 +++++++-----------------------------
 arch/sparc/kernel/unaligned_32.c    |  12 +--
 arch/sparc/mm/fault_32.c            |  13 +---
 arch/sparc/mm/fault_64.c            |   9 +--
 arch/um/kernel/ptrace.c             |  13 +---
 arch/um/kernel/trap.c               |  54 ++++++--------
 arch/xtensa/kernel/traps.c          |  10 +--
 arch/xtensa/mm/fault.c              |  19 ++---
 41 files changed, 280 insertions(+), 852 deletions(-)

Eric

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

* [REVIEW][PATCH 21/22] signal/xtensa: Consistenly use SIGBUS in do_unaligned_user
  2018-04-20 14:35 ` [REVIEW][PATCH 00/22] Simplifying siginfo users Eric W. Biederman
@ 2018-04-20 14:38   ` Eric W. Biederman
  2018-04-20 16:06     ` Max Filippov
  0 siblings, 1 reply; 3+ messages in thread
From: Eric W. Biederman @ 2018-04-20 14:38 UTC (permalink / raw)
  To: linux-arch
  Cc: linux-kernel, Eric W. Biederman, Chris Zankel, Max Filippov,
	linux-xtensa, stable

While working on changing this code to use force_sig_fault I
discovered that do_unaliged_user is sets si_signo to SIGBUS and passes
SIGSEGV to force_sig_info.  Which is just b0rked.

The code is reporting a SIGBUS error so replace the SIGSEGV with SIGBUS.

Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-xtensa@linux-xtensa.org
Cc: stable@vger.kernel.org
Fixes: 5a0015d62668 ("[PATCH] xtensa: Architecture support for Tensilica Xtensa Part 3")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 arch/xtensa/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index 51771929f341..90b509f65b6f 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -339,7 +339,7 @@ do_unaligned_user (struct pt_regs *regs)
 	info.si_errno = 0;
 	info.si_code = BUS_ADRALN;
 	info.si_addr = (void *) regs->excvaddr;
-	force_sig_info(SIGSEGV, &info, current);
+	force_sig_info(SIGBUS, &info, current);
 
 }
 #endif
-- 
2.14.1

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

* Re: [REVIEW][PATCH 21/22] signal/xtensa: Consistenly use SIGBUS in do_unaligned_user
  2018-04-20 14:38   ` [REVIEW][PATCH 21/22] signal/xtensa: Consistenly use SIGBUS in do_unaligned_user Eric W. Biederman
@ 2018-04-20 16:06     ` Max Filippov
  0 siblings, 0 replies; 3+ messages in thread
From: Max Filippov @ 2018-04-20 16:06 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Linux-Arch, LKML, Chris Zankel, linux-xtensa, stable

On Fri, Apr 20, 2018 at 7:38 AM, Eric W. Biederman
<ebiederm@xmission.com> wrote:
> While working on changing this code to use force_sig_fault I
> discovered that do_unaliged_user is sets si_signo to SIGBUS and passes
> SIGSEGV to force_sig_info.  Which is just b0rked.
>
> The code is reporting a SIGBUS error so replace the SIGSEGV with SIGBUS.
>
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: linux-xtensa@linux-xtensa.org
> Cc: stable@vger.kernel.org
> Fixes: 5a0015d62668 ("[PATCH] xtensa: Architecture support for Tensilica Xtensa Part 3")
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> ---
>  arch/xtensa/kernel/traps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Max Filippov <jcmvbkbc@gmail.com>

-- 
Thanks.
-- Max

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

end of thread, other threads:[~2018-04-20 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <878t9ilmhv.fsf@xmission.com>
2018-04-20 14:35 ` [REVIEW][PATCH 00/22] Simplifying siginfo users Eric W. Biederman
2018-04-20 14:38   ` [REVIEW][PATCH 21/22] signal/xtensa: Consistenly use SIGBUS in do_unaligned_user Eric W. Biederman
2018-04-20 16:06     ` Max Filippov

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).