History

Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

Pull kernel thread signal handling fix from Eric Biederman: "I overlooked the fact that kernel threads are created with all signals set to SIG_IGN, and accidentally caused a regression in cifs and drbd when replacing force_sig with send_sig. This is my fix for that regression. I add a new function allow_kernel_signal which allows kernel threads to receive signals sent from the kernel, but continues to ignore all signals sent from userspace. This ensures the user space interface for cifs and drbd remain the same. These kernel threads depend on blocking networking calls which block until something is received or a signal is pending. Making receiving of signals somewhat necessary for these kernel threads. Perhaps someday we can cleanup those interfaces and remove allow_kernel_signal. If not allow_kernel_signal is pretty trivial and clearly documents what is going on so I don't think we will mind carrying it" * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: signal: Allow cifs and drbd to receive their terminating signals

Linus Torvalds committed 7 years ago

Commit 287c55e2 parents 0682150 33da8e74 files · +22 −2Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/signal.h+14−1
@@ -282,6 +282,9 @@ extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping); · 281 unmodified lines
282extern void exit_signals(struct task_struct *tsk);282extern void exit_signals(struct task_struct *tsk);
283extern void kernel_sigaction(int, __sighandler_t);283extern void kernel_sigaction(int, __sighandler_t);
284 284
285#define SIG_KTHREAD ((__force __sighandler_t)2)
286#define SIG_KTHREAD_KERNEL ((__force __sighandler_t)3)
287
285static inline void allow_signal(int sig)288static inline void allow_signal(int sig)
286{289{
287 /*290 /*
@@ -289,7 +292,17 @@ static inline void allow_signal(int sig) · 1 unmodified line
289 * know it'll be handled, so that they don't get converted to292 * know it'll be handled, so that they don't get converted to
290 * SIGKILL or just silently dropped.293 * SIGKILL or just silently dropped.
291 */294 */
292 kernel_sigaction(sig, (__force __sighandler_t)2);295 kernel_sigaction(sig, SIG_KTHREAD);
296}
297
298static inline void allow_kernel_signal(int sig)
299{
300 /*
301 * Kernel threads handle their own signals. Let the signal code
302 * know signals sent by the kernel will be handled, so that they
303 * don't get silently dropped.
304 */
305 kernel_sigaction(sig, SIG_KTHREAD_KERNEL);
293}306}
294 307
295static inline void disallow_signal(int sig)308static inline void disallow_signal(int sig)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t