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-84-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:13:43 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 083/437] kernel/irq: convert debugfs helpers to read/write iterators

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

diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c
index aae0402507ed..addf000046b8 100644
--- a/kernel/irq/debugfs.c
+++ b/kernel/irq/debugfs.c
@@ -193,15 +193,15 @@ static int irq_debug_open(struct inode *inode, struct file *file)
 	return single_open(file, irq_debug_show, inode->i_private);
 }
 
-static ssize_t irq_debug_write(struct file *file, const char __user *user_buf,
-			       size_t count, loff_t *ppos)
+static ssize_t irq_debug_write(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct irq_desc *desc = file_inode(file)->i_private;
+	struct irq_desc *desc = file_inode(iocb->ki_filp)->i_private;
+	size_t count = iov_iter_count(from);
 	char buf[8] = { 0, };
 	size_t size;
 
 	size = min(sizeof(buf) - 1, count);
-	if (copy_from_user(buf, user_buf, size))
+	if (!copy_from_iter_full(buf, size, from))
 		return -EFAULT;
 
 	if (!strncmp(buf, "trigger", size)) {
@@ -215,8 +215,8 @@ static ssize_t irq_debug_write(struct file *file, const char __user *user_buf,
 
 static const struct file_operations dfs_irq_ops = {
 	.open		= irq_debug_open,
-	.write		= irq_debug_write,
-	.read		= seq_read,
+	.write_iter	= irq_debug_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