Patch "SIGNAL: Move generic copy_siginfo() to signal.h" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
SIGNAL: Move generic copy_siginfo() to signal.h
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
signal-move-generic-copy_siginfo-to-signal.h.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
ca9eb49aa9562eaadf3cea071ec7018ad6800425Mon Sep 17 00:00:00 2001
From: James Hogan <[email protected]>
Date: Mon, 8 Feb 2016 18:43:50 +0000
Subject: SIGNAL: Move generic copy_siginfo() to signal.h
From: James Hogan <[email protected]>
commit ca9eb49aa9562eaadf3cea071ec7018ad6800425 upstream.
The generic copy_siginfo() is currently defined in asm-generic/siginfo.h, after including uapi/asm-generic/siginfo.h which defines the generic struct siginfo. However this makes it awkward for an architecture to use it if it has to define its own struct siginfo (e.g. MIPS and potentially IA64), since it means that asm-generic/siginfo.h can only be included after defining the arch-specific siginfo, which may be problematic if the arch-specific definition needs definitions from uapi/asm-generic/siginfo.h.
It is possible to work around this by first including uapi/asm-generic/siginfo.h to get the constants before defining the arch-specific siginfo, and include asm-generic/siginfo.h after. However uapi headers can't be included by other uapi headers, so that first include has to be in an ifdef __kernel__, with the non __kernel__ case including the non-UAPI header instead.
Instead of that mess, move the generic copy_siginfo() definition into linux/signal.h, which allows an arch-specific uapi/asm/siginfo.h to include asm-generic/siginfo.h and define the arch-specific siginfo, and for the generic copy_siginfo() to see that arch-specific definition.
Patchwork: https://patchwork.linux-mips.org/patch/12478/
--- include/asm-generic/siginfo.h | 15 --------------- include/linux/signal.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-)
include/asm-generic/siginfo.h +0 -15
@@ -17,21 +17,6 @@struct siginfo ;void do_schedule_next_timer (struct siginfo *info); -#ifndef HAVE_ARCH_COPY_SIGINFO - -#include <linux/string.h> - -static inline void copy_siginfo (struct siginfo *to,struct siginfo *from) -{ -if (from->si_code <0 ) -memcpy (to, from,sizeof (*to)); -else -/* _sigchld is currently the largest know union member */ -memcpy (to, from, __ARCH_SI_PREAMBLE_SIZE +sizeof (from->_sifields._sigchld)); -} - -#endif -extern int copy_siginfo_to_user (struct siginfo __user *to,const struct siginfo *from);#endif
include/linux/signal.h +15 -0
@@ -28,6 +28,21 @@ struct sigpending {sigset_t signal; }; +#ifndef HAVE_ARCH_COPY_SIGINFO + +#include <linux/string.h> + +static inline void copy_siginfo (struct siginfo *to,struct siginfo *from) +{ +if (from->si_code <0 ) +memcpy (to, from,sizeof (*to)); +else +/* _sigchld is currently the largest know union member */ +memcpy (to, from, __ARCH_SI_PREAMBLE_SIZE +sizeof (from->_sifields._sigchld)); +} + +#endif +/* * Define some primitives to manipulate sigset_t. */
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/signal-move-generic-copy_siginfo-to-signal.h.patch queue-4.4/mips-kvm-fix-timer-irq-race-when-writing-cp0_compare.patch queue-4.4/mips-kvm-fix-timer-irq-race-when-freezing-timer.patch