lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 15 Feb 2016 18:49:32 -0800
From:	Keith Packard <keithp@...thp.com>
To:	linux-usb@...r.kernel.org
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, Keith Packard <keithp@...thp.com>
Subject: [PATCH] usb: check for signals in chaoskey read function

Call signal_pending before reading a chunk of data from the device so
that long read operations can be interrupted with a signal.

Signed-off-by: Keith Packard <keithp@...thp.com>
---
 drivers/usb/misc/chaoskey.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c
index 23c7948..ab87db2 100644
--- a/drivers/usb/misc/chaoskey.c
+++ b/drivers/usb/misc/chaoskey.c
@@ -394,6 +394,13 @@ static ssize_t chaoskey_read(struct file *file,
 		if (result)
 			goto bail;
 		if (dev->valid == dev->used) {
+
+			if (signal_pending(current)) {
+				result = -ERESTARTSYS;
+				mutex_unlock(&dev->lock);
+				goto bail;
+			}
+
 			result = _chaoskey_fill(dev);
 			if (result) {
 				mutex_unlock(&dev->lock);
-- 
2.7.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ