Skip to content

Commit 8cfbe7e

Browse files
Oleg Nesterovgregkh
authored andcommitted
USB: g_file_storage: call allow_signal()
New changes in the signal-handling code require compensating changes in g_file_storage. This patch (as913) by Oleg Nesterov makes the code use allow_signal() instead of sigprocmask(). From: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 1895486 commit 8cfbe7e

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎drivers/usb/gadget/file_storage.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,6 @@ struct fsg_dev {
686686
int thread_wakeup_needed;
687687
struct completion thread_notifier;
688688
struct task_struct *thread_task;
689-
sigset_t thread_signal_mask;
690689

691690
int cmnd_size;
692691
u8 cmnd[MAX_COMMAND_SIZE];
@@ -3277,8 +3276,7 @@ static void handle_exception(struct fsg_dev *fsg)
32773276
/* Clear the existing signals. Anything but SIGUSR1 is converted
32783277
* into a high-priority EXIT exception. */
32793278
for (;;) {
3280-
sig = dequeue_signal_lock(current, &fsg->thread_signal_mask,
3281-
&info);
3279+
sig = dequeue_signal_lock(current, &current->blocked, &info);
32823280
if (!sig)
32833281
break;
32843282
if (sig != SIGUSR1) {
@@ -3431,10 +3429,10 @@ static int fsg_main_thread(void *fsg_)
34313429

34323430
/* Allow the thread to be killed by a signal, but set the signal mask
34333431
* to block everything but INT, TERM, KILL, and USR1. */
3434-
siginitsetinv(&fsg->thread_signal_mask, sigmask(SIGINT) |
3435-
sigmask(SIGTERM) | sigmask(SIGKILL) |
3436-
sigmask(SIGUSR1));
3437-
sigprocmask(SIG_SETMASK, &fsg->thread_signal_mask, NULL);
3432+
allow_signal(SIGINT);
3433+
allow_signal(SIGTERM);
3434+
allow_signal(SIGKILL);
3435+
allow_signal(SIGUSR1);
34383436

34393437
/* Arrange for userspace references to be interpreted as kernel
34403438
* pointers. That way we can pass a kernel pointer to a routine

0 commit comments

Comments
 (0)