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

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/firmware/tegra/bpmp-debugfs.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c
index 4221fed70ad4..6ef756a2d638 100644
--- a/drivers/firmware/tegra/bpmp-debugfs.c
+++ b/drivers/firmware/tegra/bpmp-debugfs.c
@@ -363,21 +363,21 @@ static int bpmp_debug_show(struct seq_file *m, void *p)
 	return err;
 }
 
-static ssize_t bpmp_debug_store(struct file *file, const char __user *buf,
-		size_t count, loff_t *f_pos)
+static ssize_t bpmp_debug_store(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct inode *inode = file_inode(file);
+	struct inode *inode = file_inode(iocb->ki_filp);
 	struct tegra_bpmp *bpmp = inode->i_private;
+	size_t count = iov_iter_count(from);
 	char *databuf = NULL;
 	char fnamebuf[256];
 	const char *filename;
 	ssize_t err;
 
-	filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf));
+	filename = get_filename(bpmp, iocb->ki_filp, fnamebuf, sizeof(fnamebuf));
 	if (!filename)
 		return -ENOENT;
 
-	databuf = memdup_user(buf, count);
+	databuf = iterdup(from);
 	if (IS_ERR(databuf))
 		return PTR_ERR(databuf);
 
@@ -394,9 +394,9 @@ static int bpmp_debug_open(struct inode *inode, struct file *file)
 
 static const struct file_operations bpmp_debug_fops = {
 	.open		= bpmp_debug_open,
-	.read		= seq_read,
+	.read_iter	= seq_read_iter,
 	.llseek		= seq_lseek,
-	.write		= bpmp_debug_store,
+	.write_iter	= bpmp_debug_store,
 	.release	= single_release,
 };
 
@@ -630,11 +630,11 @@ static int debugfs_open(struct inode *inode, struct file *file)
 	return single_open_size(file, debugfs_show, file, SZ_128K);
 }
 
-static ssize_t debugfs_store(struct file *file, const char __user *buf,
-		size_t count, loff_t *f_pos)
+static ssize_t debugfs_store(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct inode *inode = file_inode(file);
+	struct inode *inode = file_inode(iocb->ki_filp);
 	struct tegra_bpmp *bpmp = inode->i_private;
+	size_t count = iov_iter_count(from);
 	const size_t datasize = count;
 	const size_t namesize = SZ_256;
 	void *datavirt, *namevirt;
@@ -644,7 +644,7 @@ static ssize_t debugfs_store(struct file *file, const char __user *buf,
 	size_t len;
 	int err;
 
-	filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf));
+	filename = get_filename(bpmp, iocb->ki_filp, fnamebuf, sizeof(fnamebuf));
 	if (!filename)
 		return -ENOENT;
 
@@ -681,9 +681,9 @@ static ssize_t debugfs_store(struct file *file, const char __user *buf,
 
 static const struct file_operations debugfs_fops = {
 	.open		= debugfs_open,
-	.read		= seq_read,
+	.read_iter	= seq_read_iter,
 	.llseek		= seq_lseek,
-	.write		= debugfs_store,
+	.write_iter	= debugfs_store,
 	.release	= single_release,
 };
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ