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-147-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:14:46 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 146/437] drm/loongson: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/gpu/drm/loongson/lsdc_crtc.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/loongson/lsdc_crtc.c b/drivers/gpu/drm/loongson/lsdc_crtc.c
index 827acab580fa..fde7c8d6cc3d 100644
--- a/drivers/gpu/drm/loongson/lsdc_crtc.c
+++ b/drivers/gpu/drm/loongson/lsdc_crtc.c
@@ -628,20 +628,18 @@ static int lsdc_crtc_man_op_open(struct inode *inode, struct file *file)
 	return single_open(file, lsdc_crtc_man_op_show, crtc);
 }
 
-static ssize_t lsdc_crtc_man_op_write(struct file *file,
-				      const char __user *ubuf,
-				      size_t len,
-				      loff_t *offp)
+static ssize_t lsdc_crtc_man_op_write(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct seq_file *m = file->private_data;
+	struct seq_file *m = iocb->ki_filp->private_data;
 	struct lsdc_crtc *lcrtc = m->private;
 	const struct lsdc_crtc_hw_ops *ops = lcrtc->hw_ops;
+	size_t len = iov_iter_count(from);
 	char buf[16];
 
 	if (len > sizeof(buf) - 1)
 		return -EINVAL;
 
-	if (copy_from_user(buf, ubuf, len))
+	if (!copy_from_iter_full(buf, len, from))
 		return -EFAULT;
 
 	buf[len] = '\0';
@@ -663,10 +661,10 @@ static ssize_t lsdc_crtc_man_op_write(struct file *file,
 static const struct file_operations lsdc_crtc_man_op_fops = {
 	.owner = THIS_MODULE,
 	.open = lsdc_crtc_man_op_open,
-	.read = seq_read,
+	.read_iter = seq_read_iter,
 	.llseek = seq_lseek,
 	.release = single_release,
-	.write = lsdc_crtc_man_op_write,
+	.write_iter = lsdc_crtc_man_op_write,
 };
 
 static int lsdc_crtc_late_register(struct drm_crtc *crtc)
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ