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-255-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:16:34 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 254/437] watchdog: sbc_fitpc2_wdt: convert to read/write iterators

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

diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c
index b8eb8d5ca1af..1619f92814cf 100644
--- a/drivers/watchdog/sbc_fitpc2_wdt.c
+++ b/drivers/watchdog/sbc_fitpc2_wdt.c
@@ -76,9 +76,9 @@ static int fitpc2_wdt_open(struct inode *inode, struct file *file)
 	return stream_open(inode, file);
 }
 
-static ssize_t fitpc2_wdt_write(struct file *file, const char __user *data,
-						size_t len, loff_t *ppos)
+static ssize_t fitpc2_wdt_write(struct kiocb *iocb, struct iov_iter *from)
 {
+	size_t len = iov_iter_count(from);
 	size_t i;
 
 	if (!len)
@@ -94,7 +94,7 @@ static ssize_t fitpc2_wdt_write(struct file *file, const char __user *data,
 	for (i = 0; i != len; i++) {
 		char c;
 
-		if (get_user(c, data + i))
+		if (get_iter(c, from))
 			return -EFAULT;
 
 		if (c == 'V')
@@ -107,7 +107,6 @@ static ssize_t fitpc2_wdt_write(struct file *file, const char __user *data,
 	return len;
 }
 
-
 static const struct watchdog_info ident = {
 	.options	= WDIOF_MAGICCLOSE | WDIOF_SETTIMEOUT |
 				WDIOF_KEEPALIVEPING,
@@ -182,7 +181,7 @@ static int fitpc2_wdt_release(struct inode *inode, struct file *file)
 static const struct file_operations fitpc2_wdt_fops = {
 	.owner		= THIS_MODULE,
 	.llseek		= no_llseek,
-	.write		= fitpc2_wdt_write,
+	.write_iter	= fitpc2_wdt_write,
 	.unlocked_ioctl	= fitpc2_wdt_ioctl,
 	.compat_ioctl	= compat_ptr_ioctl,
 	.open		= fitpc2_wdt_open,
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ