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]
Message-ID: <20240411153126.16201-359-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:18:18 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 358/437] hwmon: fschmd: convert to read/write iterators

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

diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index b30512a705a7..896a073811a0 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -848,11 +848,11 @@ static int watchdog_release(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)
 {
 	int ret;
-	struct fschmd_data *data = filp->private_data;
+	struct fschmd_data *data = iocb->ki_filp->private_data;
+	size_t count = iov_iter_count(from);
 
 	if (count) {
 		if (!nowayout) {
@@ -863,7 +863,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;
@@ -951,7 +951,7 @@ static const struct file_operations watchdog_fops = {
 	.llseek = no_llseek,
 	.open = watchdog_open,
 	.release = watchdog_release,
-	.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