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

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

diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c
index ea378c0ed549..3b60ee911c68 100644
--- a/drivers/char/nwbutton.c
+++ b/drivers/char/nwbutton.c
@@ -165,14 +165,13 @@ static irqreturn_t button_handler (int irq, void *dev_id)
  * device at any one time.
  */
 
-static int button_read (struct file *filp, char __user *buffer,
-			size_t count, loff_t *ppos)
+static int button_read (struct kiocb *iocb, struct iov_iter *to)
 {
 	DEFINE_WAIT(wait);
 	prepare_to_wait(&button_wait_queue, &wait, TASK_INTERRUPTIBLE);
 	schedule();
 	finish_wait(&button_wait_queue, &wait);
-	return (copy_to_user (buffer, &button_output_buffer, bcount))
+	return (!copy_to_iter_full(&button_output_buffer, bcount, to))
 		 ? -EFAULT : bcount;
 }
 
@@ -184,7 +183,7 @@ static int button_read (struct file *filp, char __user *buffer,
 
 static const struct file_operations button_fops = {
 	.owner		= THIS_MODULE,
-	.read		= button_read,
+	.read_iter	= button_read,
 	.llseek		= noop_llseek,
 };
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ