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-17-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:12:36 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 016/437] char/dsp1620: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/char/ds1620.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c
index cf89a9631107..036f1db308d2 100644
--- a/drivers/char/ds1620.c
+++ b/drivers/char/ds1620.c
@@ -216,8 +216,7 @@ static int ds1620_open(struct inode *inode, struct file *file)
 	return stream_open(inode, file);
 }
 
-static ssize_t
-ds1620_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
+static ssize_t ds1620_read(struct kiocb *iocb, struct iov_iter *to)
 {
 	signed int cur_temp;
 	signed char cur_temp_degF;
@@ -227,7 +226,7 @@ ds1620_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
 	/* convert to Fahrenheit, as per wdt.c */
 	cur_temp_degF = (cur_temp * 9) / 5 + 32;
 
-	if (copy_to_user(buf, &cur_temp_degF, 1))
+	if (!copy_to_iter_full(&cur_temp_degF, 1, to))
 		return -EFAULT;
 
 	return 1;
@@ -351,7 +350,7 @@ static int ds1620_proc_therm_show(struct seq_file *m, void *v)
 static const struct file_operations ds1620_fops = {
 	.owner		= THIS_MODULE,
 	.open		= ds1620_open,
-	.read		= ds1620_read,
+	.read_iter	= ds1620_read,
 	.unlocked_ioctl	= ds1620_unlocked_ioctl,
 	.llseek		= no_llseek,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ