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:	Tue, 24 Mar 2009 16:12:46 -0500
From:	stoyboyker@...il.com
To:	linux-kernel@...r.kernel.org
Cc:	Stoyan Gaydarov <stoyboyker@...il.com>, hdegoede@...hat.com
Subject: [PATCH 11/13] [hwmon] changed ioctls to unlocked

From: Stoyan Gaydarov <stoyboyker@...il.com>

Signed-off-by: Stoyan Gaydarov <stoyboyker@...il.com>
---
 drivers/hwmon/fschmd.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index d07f4ef..79efb7b 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -40,6 +40,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
+#include <linux/smp_lock.h>
 #include <linux/sysfs.h>
 #include <linux/dmi.h>
 #include <linux/fs.h>
@@ -769,15 +770,17 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf,
 	return count;
 }
 
-static int watchdog_ioctl(struct inode *inode, struct file *filp,
-	unsigned int cmd, unsigned long arg)
+static long watchdog_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
 				WDIOF_CARDRESET,
 		.identity = "FSC watchdog"
 	};
-	int i, ret = 0;
+
+	lock_kernel();
+
+	int i, ret;
 	struct fschmd_data *data = filp->private_data;
 
 	switch (cmd) {
@@ -837,6 +840,10 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp,
 		ret = -ENOTTY;
 	}
 
+	if(!ret)
+		ret = -ENOTTY;
+
+	unlock_kernel();
 	return ret;
 }
 
@@ -846,7 +853,7 @@ static struct file_operations watchdog_fops = {
 	.open = watchdog_open,
 	.release = watchdog_release,
 	.write = watchdog_write,
-	.ioctl = watchdog_ioctl,
+	.unlocked_ioctl = watchdog_ioctl,
 };
 
 
-- 
1.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ