android_kernel_samsung_a7y1.../kernel
Eric W. Biederman 4ab4bf67b6 signal: Allow cifs and drbd to receive their terminating signals
[ Upstream commit 33da8e7c814f77310250bb54a9db36a44c5de784 ]

My recent to change to only use force_sig for a synchronous events
wound up breaking signal reception cifs and drbd.  I had overlooked
the fact that by default kthreads start out with all signals set to
SIG_IGN.  So a change I thought was safe turned out to have made it
impossible for those kernel thread to catch their signals.

Reverting the work on force_sig is a bad idea because what the code
was doing was very much a misuse of force_sig.  As the way force_sig
ultimately allowed the signal to happen was to change the signal
handler to SIG_DFL.  Which after the first signal will allow userspace
to send signals to these kernel threads.  At least for
wake_ack_receiver in drbd that does not appear actively wrong.

So correct this problem by adding allow_kernel_signal that will allow
signals whose siginfo reports they were sent by the kernel through,
but will not allow userspace generated signals, and update cifs and
drbd to call allow_kernel_signal in an appropriate place so that their
thread can receive this signal.

Fixing things this way ensures that userspace won't be able to send
signals and cause problems, that it is clear which signals the
threads are expecting to receive, and it guarantees that nothing
else in the system will be affected.

This change was partly inspired by similar cifs and drbd patches that
added allow_signal.

Reported-by: ronnie sahlberg <ronniesahlberg@gmail.com>
Reported-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Tested-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Cc: Steve French <smfrench@gmail.com>
Cc: Philipp Reisner <philipp.reisner@linbit.com>
Cc: David Laight <David.Laight@ACULAB.COM>
Fixes: 247bc9470b1e ("cifs: fix rmmod regression in cifs.ko caused by force_sig changes")
Fixes: 72abe3bcf091 ("signal/cifs: Fix cifs_put_tcp_session to call send_sig instead of force_sig")
Fixes: fee109901f39 ("signal/drbd: Use send_sig not force_sig")
Fixes: 3cf5d076fb4d ("signal: Remove task parameter from force_sig")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 13:42:54 +02:00
..
bpf bpf: silence warning messages in core 2020-04-06 19:54:55 +02:00
configs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debug kdb: do a sanity check on the cpu in kdb_per_cpu() 2020-04-07 13:41:56 +02:00
events signal: Properly deliver SIGILL from uprobes 2020-04-07 12:27:23 +02:00
gcov A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
irq genirq: Prevent NULL pointer dereference in resend_irqs() 2020-04-06 21:35:35 +02:00
livepatch A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking locking/spinlock/debug: Fix various data races 2020-04-07 13:28:27 +02:00
power PM / Hibernate: Call flush_icache_range() on pages restored in-place 2020-04-06 12:52:20 +02:00
printk printk: fix integer overflow in setup_log_buf() 2020-04-07 12:34:15 +02:00
rcu rcutorture: Fix cleanup path for invalid torture_type strings 2020-04-06 18:20:15 +02:00
sched sched/fair: Scale bandwidth quota and period without losing quota/period ratio precision 2020-04-07 12:45:36 +02:00
time hrtimer: Annotate lockless access to timer->state 2020-04-07 13:24:02 +02:00
trace tracing: Have stack tracer compile when MCOUNT_INSN_SIZE is not defined 2020-04-07 13:29:37 +02:00
acct.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
async.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
audit_fsnotify.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
audit_tree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
audit_watch.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
audit.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
audit.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
auditfilter.c audit: fix a memory leak bug 2020-04-06 18:18:45 +02:00
auditsc.c audit: print empty EXECVE args 2020-04-07 12:36:13 +02:00
backtracetest.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bounds.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
capability.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cgroup_freezer.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cgroup_pids.c cgroup: pids: use atomic64_t for pids->limit 2020-04-07 13:07:11 +02:00
cgroup.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
configs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
context_tracking.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpu_pm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cpu.c cpu/speculation: Warn on unsupported mitigations= parameter 2020-04-06 19:17:21 +02:00
cpuset.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crash_dump.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cred.c access: avoid the RCU grace period for the temporary subjective credentials 2020-04-06 20:24:58 +02:00
delayacct.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dma.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
elfcore.c kernel/elfcore.c: include proper prototypes 2020-04-07 08:08:10 +02:00
exec_domain.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
exit.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extable.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fork.c kernel/sysctl.c: do not override max_threads provided by userspace 2020-04-07 08:09:55 +02:00
freezer.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
futex_compat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
futex.c futex: Fix futex lock the wrong page 2020-04-06 19:02:46 +02:00
groups.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hung_task.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
irq_work.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
jump_label.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kallsyms.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kaslr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kcmp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.freezer A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.hz A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.locks A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.preempt A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kcov.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kexec_core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kexec_file.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kexec_internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kexec.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kmod.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kprobes.c kprobes: Don't call BUG_ON() if there is a kprobe in use on free list 2020-04-07 12:27:35 +02:00
ksysfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kthread.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
latencytop.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
membarrier.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
memremap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
module_signing.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
module-internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
module.c kernel/module.c: wakeup processes in module_wq on module unload 2020-04-07 13:08:13 +02:00
notifier.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nsproxy.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
padata.c padata: use smp_mb in padata_reorder to avoid orphaned padata jobs 2020-04-06 20:04:27 +02:00
panic.c panic: ensure preemption is disabled during panic() 2020-04-07 08:08:25 +02:00
params.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pid_namespace.c signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig 2020-04-06 19:54:23 +02:00
pid.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
profile.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ptrace.c ptrace: Fix ->ptracer_cred handling for PTRACE_TRACEME 2020-04-06 19:20:56 +02:00
range.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
reboot.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
relay.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
resource.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
seccomp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
signal.c signal: Allow cifs and drbd to receive their terminating signals 2020-04-07 13:42:54 +02:00
smp.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
smpboot.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
smpboot.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
softirq.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stacktrace.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stop_machine.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sys_ni.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sys.c kernel/sys.c: prctl: fix false positive in validate_prctl_map() 2020-04-06 19:01:43 +02:00
sysctl_binary.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysctl.c kernel: sysctl: make drop_caches write-only 2020-04-07 13:23:45 +02:00
task_work.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
taskstats.c taskstats: fix data-race 2020-04-07 13:24:32 +02:00
test_kprobes.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
torture.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tracepoint.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tsacct.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
uid16.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
up.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
user_namespace.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
user-return-notifier.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
user.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
utsname_sysctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
utsname.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
watchdog.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
workqueue_internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
workqueue.c workqueue: Fix missing kfree(rescuer) in destroy_workqueue() 2020-04-07 13:08:09 +02:00