linux_dsm_epyc7002/arch
Martin Schwidefsky 20b40a794b [S390] signal race with restarting system calls
For a ERESTARTNOHAND/ERESTARTSYS/ERESTARTNOINTR restarting system call
do_signal will prepare the restart of the system call with a rewind of
the PSW before calling get_signal_to_deliver (where the debugger might
take control). For A ERESTART_RESTARTBLOCK restarting system call
do_signal will set -EINTR as return code.
There are two issues with this approach:
1) strace never sees ERESTARTNOHAND, ERESTARTSYS, ERESTARTNOINTR or
   ERESTART_RESTARTBLOCK as the rewinding already took place or the
   return code has been changed to -EINTR
2) if get_signal_to_deliver does not return with a signal to deliver
   the restart via the repeat of the svc instruction is left in place.
   This opens a race if another signal is made pending before the
   system call instruction can be reexecuted. The original system call
   will be restarted even if the second signal would have ended the
   system call with -EINTR.

These two issues can be solved by dropping the early rewind of the
system call before get_signal_to_deliver has been called and by using
the TIF_RESTART_SVC magic to do the restart if no signal has to be
delivered. The only situation where the system call restart via the
repeat of the svc instruction is appropriate is when a SA_RESTART
signal is delivered to user space.

Unfortunately this breaks inferior calls by the debugger again. The
system call number and the length of the system call instruction is
lost over the inferior call and user space will see ERESTARTNOHAND/
ERESTARTSYS/ERESTARTNOINTR/ERESTART_RESTARTBLOCK. To correct this a
new ptrace interface is added to save/restore the system call number
and system call instruction length.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2011-10-30 15:16:43 +01:00
..
alpha Merge branch 'for-3.2' of git://linux-nfs.org/~bfields/linux 2011-10-25 15:42:01 +02:00
arm Merge branch 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6 2011-10-29 07:29:40 -07:00
avr32 All Arch: remove linkage for sys_nfsservctl system call 2011-08-26 15:09:58 -07:00
blackfin Blackfin: irq: remove IRQF_DISABLED 2011-10-26 04:22:26 -04:00
cris Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2011-10-25 13:25:22 +02:00
frv All Arch: remove linkage for sys_nfsservctl system call 2011-08-26 15:09:58 -07:00
h8300 Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6 2011-10-29 07:27:45 -07:00
ia64 Merge branch 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2011-10-26 16:11:53 +02:00
m32r m32r: Allow use of atomic64 2011-10-17 23:29:43 -04:00
m68k Merge branch 'for-linus' of git://github.com/gregungerer/m68knommu 2011-10-25 16:25:48 +02:00
microblaze microblaze: add missing CONFIG_ prefixes 2011-10-13 10:39:24 +02:00
mips Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2011-10-28 14:25:01 -07:00
mn10300 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2011-10-26 17:15:03 +02:00
openrisc doc: fix broken references 2011-09-27 18:08:04 +02:00
parisc Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue 2011-10-28 10:49:34 -07:00
powerpc Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue 2011-10-28 10:49:34 -07:00
s390 [S390] signal race with restarting system calls 2011-10-30 15:16:43 +01:00
score modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
sh net: sh_eth: move the asm/sh_eth.h to include/linux/ 2011-09-28 13:41:51 -04:00
sparc compat: sync compat_stats with statfs. 2011-10-28 14:58:53 +02:00
tile Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2011-10-26 17:15:03 +02:00
um Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2011-10-26 17:15:03 +02:00
unicore32 doc: fix broken references 2011-09-27 18:08:04 +02:00
x86 Merge git://github.com/rustyrussell/linux 2011-10-29 07:52:16 -07:00
xtensa Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2011-10-26 17:15:03 +02:00
.gitignore
Kconfig Add Kconfig option ARCH_HAVE_NMI_SAFE_CMPXCHG 2011-08-03 11:12:37 -04:00