Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1255412
| From | Oleg Nesterov <oleg@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH -mm 2/3] nbd: nbd_thread_recv: remove the buggy kernel_dequeue_signal() |
| Date | 2015-10-25 15:40 +0100 |
| Message-ID | <qnuCK-481-1@gated-at.bofh.it> (permalink) |
| References | <qnuCK-481-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
nbd_thread_recv() is called by userspace, it is very wrong to dequeue
and throw out a signal.
I do not understand why nbd_thread_recv() (and nbd_thread_send() btw)
does sock_shutdown(); the caller, __nbd_ioctl(NBD_DO_IT) does this too.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
drivers/block/nbd.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index e5d96e5..0ffd73c 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -444,9 +444,8 @@ static int nbd_thread_recv(struct nbd_device *nbd)
spin_unlock_irqrestore(&nbd->tasks_lock, flags);
if (signal_pending(current)) {
- ret = kernel_dequeue_signal(NULL);
- dev_warn(nbd_to_dev(nbd), "pid %d, %s, got signal %d\n",
- task_pid_nr(current), current->comm, ret);
+ dev_warn(nbd_to_dev(nbd), "pid %d, %s, got signal",
+ task_pid_nr(current), current->comm);
mutex_lock(&nbd->tx_lock);
sock_shutdown(nbd);
mutex_unlock(&nbd->tx_lock);
--
1.5.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH -mm 2/3] nbd: nbd_thread_recv: remove the buggy kernel_dequeue_signal() Oleg Nesterov <oleg@redhat.com> - 2015-10-25 15:40 +0100
Re: [PATCH -mm 2/3] nbd: nbd_thread_recv: remove the buggy kernel_dequeue_signal() Markus Pargmann <mpa@pengutronix.de> - 2015-10-26 08:50 +0100
Re: [PATCH -mm 2/3] nbd: nbd_thread_recv: remove the buggy kernel_dequeue_signal() Oleg Nesterov <oleg@redhat.com> - 2015-10-28 16:00 +0100
csiph-web