1
0
Fork 0
remarkable-linux/drivers
Anton Vorontsov b82c32872d sysrq: use SEND_SIG_FORCED instead of force_sig()
Change send_sig_all() to use do_send_sig_info(SEND_SIG_FORCED) instead
of force_sig(SIGKILL).  With the recent changes we do not need force_ to
kill the CLONE_NEWPID tasks.

And this is more correct.  force_sig() can race with the exiting thread,
while do_send_sig_info(group => true) kill the whole process.

Some more notes from Oleg Nesterov:

> Just one note. This change makes no difference for sysrq_handle_kill().
> But it obviously changes the behaviour sysrq_handle_term(). I think
> this is fine, if you want to really kill the task which blocks/ignores
> SIGTERM you can use sysrq_handle_kill().
>
> Even ignoring the reasons why force_sig() is simply wrong here,
> force_sig(SIGTERM) looks strange. The task won't be killed if it has
> a handler, but SIG_IGN can't help. However if it has the handler
> but blocks SIGTERM temporary (this is very common) it will be killed.

Also,

> force_sig() can't kill the process if the main thread has already
> exited. IOW, it is trivial to create the process which can't be
> killed by sysrq.

So, this patch fixes the issue.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-05 15:25:50 -07:00
..
accessibility
acpi
amba
ata 1) AHCI regression fix. A recent "make driver conform to spec" change 2012-03-22 20:22:30 -07:00
atm eni: fix driver remove function and driver probe error path. 2012-03-16 23:13:20 -07:00
auxdisplay
base The following text was taken from the original review request: 2012-03-24 10:41:37 -07:00
bcma
block nbd: rename the nbd_device variable from lo to nbd 2012-03-28 17:14:37 -07:00
bluetooth
cdrom powerpc: Remove some of the legacy iSeries specific device drivers 2012-03-16 09:28:05 +11:00
char ipmi: use locks on watchdog timeout set on reboot 2012-03-28 17:14:36 -07:00
clk
clocksource ARM: device tree work 2012-03-27 16:47:35 -07:00
connector
cpufreq Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq 2012-03-23 17:56:39 -07:00
cpuidle
crypto Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-22 18:15:32 -07:00
dca
devfreq ARM: global cleanups 2012-03-27 16:03:32 -07:00
dio
dma Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
edac The following text was taken from the original review request: 2012-03-24 10:41:37 -07:00
eisa
firewire IEEE 1394 (FireWire) subsystem updates post v3.3: 2012-03-22 20:31:15 -07:00
firmware
gpio Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
gpu The following text was taken from the original review request: 2012-03-24 10:08:39 -07:00
hid Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-03-23 14:39:09 -07:00
hv Tools: hv: Support enumeration from all the pools 2012-03-16 13:36:04 -07:00
hwmon hwmon: Add MCP3021 ADC driver 2012-03-23 10:02:20 +01:00
hwspinlock
i2c ARM: device tree work 2012-03-27 16:47:35 -07:00
ide ide: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:17 +08:00
idle drivers/idle/intel_idle.c: fix confusing code identation 2012-03-21 17:54:54 -07:00
ieee802154
infiniband Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2012-03-22 12:38:04 -07:00
input Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
iommu The IOMMU updates for this round are not very large patch-wise. But 2012-03-23 14:15:07 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
leds ARM: board specific updates 2012-03-27 16:27:28 -07:00
lguest
macintosh Core device tree changes for Linux v3.4 2012-03-21 10:30:03 -07:00
mca
md md updates for 3.4 2012-03-22 12:29:50 -07:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-03-23 14:39:09 -07:00
memstick memstick: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:19 +08:00
message
mfd Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
misc ARM: device tree work 2012-03-27 16:47:35 -07:00
mmc ARM: driver specific updates 2012-03-27 16:41:24 -07:00
mtd Merge branch 'for-linus-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2012-03-27 18:29:53 -07:00
net Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
nfc
nubus
of Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
oprofile tidy up after d_make_root() conversion 2012-03-20 21:29:37 -04:00
parisc Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-03-23 14:02:12 -07:00
parport
pci Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-03-23 14:02:12 -07:00
pcmcia Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
pinctrl pinctrl: support pinconfig on the U300 2012-03-12 22:49:03 +01:00
platform Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-03-23 14:02:12 -07:00
pnp
power The following text was taken from the original review request: 2012-03-24 10:41:37 -07:00
pps
ps3
ptp phc: Update author's email address. 2012-03-17 01:41:43 -07:00
rapidio rapidio/tsi721: fix bug in register offset definitions 2012-03-15 17:03:03 -07:00
regulator ARM: driver specific updates 2012-03-27 16:41:24 -07:00
remoteproc
rpmsg
rtc Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-27 18:36:38 -07:00
sbus
scsi Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
sfi
sh
sn
spi ARM: global cleanups 2012-03-27 16:03:32 -07:00
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
staging The following text was taken from the original review request: 2012-03-24 10:24:31 -07:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2012-03-22 12:38:04 -07:00
tc
thermal
tty sysrq: use SEND_SIG_FORCED instead of force_sig() 2012-04-05 15:25:50 -07:00
uio
usb Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
uwb uwb: use for_each_clear_bit() 2012-03-23 16:58:34 -07:00
vhost Merge branch 'vhost-net' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost 2012-03-23 14:46:48 -04:00
video backlight: fix typo in tosa_lcd.c 2012-03-28 17:14:37 -07:00
virt
virtio
vlynq
w1
watchdog ARM: device tree work 2012-03-27 16:47:35 -07:00
xen One tiny feature that accidentally got lost in the initial git pull: 2012-03-24 12:20:25 -07:00
zorro
Kconfig remoteproc/rpmsg: new subsystem 2012-03-27 16:30:09 -07:00
Makefile remoteproc/rpmsg: new subsystem 2012-03-27 16:30:09 -07:00