Skip to content

siginfo fixes/cleanups esp SI_USER

Eric W. Biederman linux-arch linux-arm-kernel linux-metag linux-parisc linux-sh linuxppc-dev lkml openrisc stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 30 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11signal: Simplify and fix kdb_send_sigkernel/debug/kdb/kdb_main.c kernel/debug/kdb/kdb_private.h kernel/signal.c+10 -160 replies
2/11signal/sh: Ensure si_signo is initialized in do_divide_errorarch/sh/kernel/traps_32.c+2 -10 replies
3/11signal/openrisc: Fix do_unaligned_access to send the proper signalarch/openrisc/kernel/traps.c+5 -52 replies
4/11signal/parisc: Document a conflict with SI_USER with SIGFPEarch/parisc/include/uapi/asm/siginfo.h arch/parisc/kernel/traps.c+8 -16 replies
5/11signal/metag: Document a conflict with SI_USER with SIGFPEarch/metag/include/uapi/asm/siginfo.h arch/metag/kernel/traps.c+8 -10 replies
6/11signal/powerpc: Document conflicts with SI_USER and SIGFPE and SIGTRAParch/powerpc/include/uapi/asm/siginfo.h arch/powerpc/kernel/traps.c+20 -50 replies
7/11signal/arm64: Document conflicts with SI_USER and SIGFPE,SIGTRAP,SIGBUSarch/arm64/include/uapi/asm/siginfo.h arch/arm64/kernel/fpsimd.c arch/arm64/mm/fault.c +1 more+83 -5818 replies
8/11signal/arm: Document conflicts with SI_USER and SIGFPEarch/arm/include/uapi/asm/siginfo.h arch/arm/vfp/vfpmodule.c+14 -14 replies
9/11signal: Reduce copy_siginfo to just a memcpyinclude/linux/signal.h+2 -60 replies
10/11signal: Introduce clear_siginfoinclude/linux/signal.h+5 -00 replies
11/11signal: Ensure generic siginfos the kernel sends have all bits initializedfs/fcntl.c ipc/mqueue.c kernel/signal.c+10 -10 replies

Reviews trailers per patch

1 of 11 patches has a Reviewed-by or Acked-by.

PatchStafford Horne
1/11
2/11
3/11A-b
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/11] siginfo fixes/cleanups esp SI_USER

The following changes are available at:
git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git siginfo-minor-fixesv2

While answering a question about my earlier introduction to siginfo_layout I realized that the code introduces a small number of cases where unitialized memory is copied to userspace as a result of the fact that SI_USER is sometimes confused with another si_code.

This modifies all of the places in the kernel that generate a signal with si_code == SI_USER to fully initialize all of siginfo. Further this change updates architectures that are using si_code of 0 to mean something other than SI_USER to use TRAP_FIXME, FPE_FIXME, or BUS_FIXME to document the problem.

With all these changes take together there is no danger of copying unitialized values to userspace when SI_USER is mistaken for TRAP_FIXME, FPE_FIXME or BUS_FIXME.

This series also contains a fix for sh and a fix for openrisc where they are improperly generating a signal and the fix is obvious.

Eric W. Biederman (11):
signal: Simplify and fix kdb_send_sig
signal/sh: Ensure si_signo is initialized in do_divide_error signal/openrisc: Fix do_unaligned_access to send the proper signal signal/parisc: Document a conflict with SI_USER with SIGFPE signal/metag: Document a conflict with SI_USER with SIGFPE signal/powerpc: Document conflicts with SI_USER and SIGFPE and SIGTRAP signal/arm64: Document conflicts with SI_USER and SIGFPE,SIGTRAP,SIGBUS signal/arm: Document conflicts with SI_USER and SIGFPE
signal: Reduce copy_siginfo to just a memcpy
signal: Introduce clear_siginfo
signal: Ensure generic siginfos the kernel sends have all bits initialized

 arch/arm/include/uapi/asm/siginfo.h     |  13 ++++
 arch/arm/vfp/vfpmodule.c                |   2 +-
 arch/arm64/include/uapi/asm/siginfo.h   |  21 ++++++
 arch/arm64/kernel/fpsimd.c              |   2 +-
 arch/arm64/mm/fault.c                   | 114 ++++++++++++++++----------------
 arch/metag/include/uapi/asm/siginfo.h   |   7 ++
 arch/metag/kernel/traps.c               |   2 +-
 arch/openrisc/kernel/traps.c            |  10 +--
 arch/parisc/include/uapi/asm/siginfo.h  |   7 ++
 arch/parisc/kernel/traps.c              |   2 +-
 arch/powerpc/include/uapi/asm/siginfo.h |  15 +++++
 arch/powerpc/kernel/traps.c             |  10 +--
 arch/sh/kernel/traps_32.c               |   3 +-
 fs/fcntl.c                              |   1 +
 include/linux/signal.h                  |  13 ++--
 ipc/mqueue.c                            |   1 +
 kernel/debug/kdb/kdb_main.c             |  10 +--
 kernel/debug/kdb/kdb_private.h          |   2 +-
 kernel/signal.c                         |  27 +++++---
 19 files changed, 167 insertions(+), 95 deletions(-)