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-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 11 Apr 2024 09:18:19 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 359/437] hwmon: w83793: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/hwmon/w83793.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index 96bab94ba899..7594fc588112 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -1352,11 +1352,11 @@ static int watchdog_close(struct inode *inode, struct file *filp)
 	return 0;
 }
 
-static ssize_t watchdog_write(struct file *filp, const char __user *buf,
-	size_t count, loff_t *offset)
+static ssize_t watchdog_write(struct kiocb *iocb, struct iov_iter *from)
 {
 	ssize_t ret;
-	struct w83793_data *data = filp->private_data;
+	struct w83793_data *data = iocb->ki_filp->private_data;
+	size_t count = iov_iter_count(from);
 
 	if (count) {
 		if (!nowayout) {
@@ -1367,7 +1367,7 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf,
 
 			for (i = 0; i != count; i++) {
 				char c;
-				if (get_user(c, buf + i))
+				if (get_iter(c, from))
 					return -EFAULT;
 				if (c == 'V')
 					data->watchdog_expect_close = 1;
@@ -1454,7 +1454,7 @@ static const struct file_operations watchdog_fops = {
 	.llseek = no_llseek,
 	.open = watchdog_open,
 	.release = watchdog_close,
-	.write = watchdog_write,
+	.write_iter = watchdog_write,
 	.unlocked_ioctl = watchdog_ioctl,
 	.compat_ioctl = compat_ptr_ioctl,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ