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-419-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:19:18 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 418/437] media: cec: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/media/cec/core/cec-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c
index 5a54db839e5d..307763fa251d 100644
--- a/drivers/media/cec/core/cec-core.c
+++ b/drivers/media/cec/core/cec-core.c
@@ -200,16 +200,16 @@ static void cec_devnode_unregister(struct cec_adapter *adap)
 }
 
 #ifdef CONFIG_DEBUG_FS
-static ssize_t cec_error_inj_write(struct file *file,
-	const char __user *ubuf, size_t count, loff_t *ppos)
+static ssize_t cec_error_inj_write(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct seq_file *sf = file->private_data;
+	struct seq_file *sf = iocb->ki_filp->private_data;
 	struct cec_adapter *adap = sf->private;
+	size_t count = iov_iter_count(from);
 	char *buf;
 	char *line;
 	char *p;
 
-	buf = memdup_user_nul(ubuf, min_t(size_t, PAGE_SIZE, count));
+	buf = iterdup_nul(from, min_t(size_t, PAGE_SIZE, count));
 	if (IS_ERR(buf))
 		return PTR_ERR(buf);
 	p = buf;
@@ -241,8 +241,8 @@ static int cec_error_inj_open(struct inode *inode, struct file *file)
 
 static const struct file_operations cec_error_inj_fops = {
 	.open = cec_error_inj_open,
-	.write = cec_error_inj_write,
-	.read = seq_read,
+	.write_iter = cec_error_inj_write,
+	.read_iter = seq_read_iter,
 	.llseek = seq_lseek,
 	.release = single_release,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ