Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.33 KB | None | 0 0
  1. diff --git a/fs/signalfd.c b/fs/signalfd.c
  2. index 44b6845b071c..cc72b5b08946 100644
  3. --- a/fs/signalfd.c
  4. +++ b/fs/signalfd.c
  5. @@ -50,6 +50,7 @@ void signalfd_cleanup(struct sighand_struct *sighand)
  6.  
  7.  struct signalfd_ctx {
  8.     sigset_t sigmask;
  9. +   struct task_struct *task;
  10.  };
  11.  
  12.  static int signalfd_release(struct inode *inode, struct file *file)
  13. @@ -63,14 +64,14 @@ static __poll_t signalfd_poll(struct file *file, poll_table *wait)
  14.     struct signalfd_ctx *ctx = file->private_data;
  15.     __poll_t events = 0;
  16.  
  17. -   poll_wait(file, &current->sighand->signalfd_wqh, wait);
  18. +   poll_wait(file, &ctx->task->sighand->signalfd_wqh, wait);
  19.  
  20. -   spin_lock_irq(&current->sighand->siglock);
  21. -   if (next_signal(&current->pending, &ctx->sigmask) ||
  22. -       next_signal(&current->signal->shared_pending,
  23. +   spin_lock_irq(&ctx->task->sighand->siglock);
  24. +   if (next_signal(&ctx->task->pending, &ctx->sigmask) ||
  25. +       next_signal(&ctx->task->signal->shared_pending,
  26.             &ctx->sigmask))
  27.         events |= EPOLLIN;
  28. -   spin_unlock_irq(&current->sighand->siglock);
  29. +   spin_unlock_irq(&ctx->task->sighand->siglock);
  30.  
  31.     return events;
  32.  }
  33. @@ -280,6 +281,7 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags)
  34.             return -ENOMEM;
  35.  
  36.         ctx->sigmask = *mask;
  37. +       ctx->task = current;
  38.  
  39.         /*
  40.          * When we call this, the initialization must be complete, since
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement