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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-337-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:17:56 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 336/437] arch/parisc: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 arch/parisc/kernel/perf.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index b0f0816879df..a564c56ebb6f 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -181,7 +181,7 @@ static const uint64_t *bitmask_array;   /* array of bitmasks to use */
 static int perf_config(uint32_t *image_ptr);
 static int perf_release(struct inode *inode, struct file *file);
 static int perf_open(struct inode *inode, struct file *file);
-static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos);
+static ssize_t perf_read(struct kiocb *iocb, struct iov_iter *to);
 static ssize_t perf_write(struct file *file, const char __user *buf,
 	size_t count, loff_t *ppos);
 static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
@@ -273,7 +273,7 @@ static int perf_release(struct inode *inode, struct file *file)
 /*
  * Read does nothing for this driver
  */
-static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos)
+static ssize_t perf_read(struct kiocb *iocb, struct iov_iter *to)
 {
 	return 0;
 }
@@ -285,9 +285,9 @@ static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t
  * called on the processor that the download should happen
  * on.
  */
-static ssize_t perf_write(struct file *file, const char __user *buf,
-	size_t count, loff_t *ppos)
+static ssize_t perf_write(struct kiocb *iocb, struct iov_iter *from)
 {
+	size_t count = iov_iter_count(from);
 	size_t image_size __maybe_unused;
 	uint32_t image_type;
 	uint32_t interface_type;
@@ -306,7 +306,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf,
 	if (count != sizeof(uint32_t))
 		return -EIO;
 
-	if (copy_from_user(&image_type, buf, sizeof(uint32_t)))
+	if (!copy_from_iter_full(&image_type, sizeof(uint32_t), from))
 		return -EFAULT;
 
 	/* Get the interface type and test type */
@@ -467,8 +467,8 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
 static const struct file_operations perf_fops = {
 	.llseek = no_llseek,
-	.read = perf_read,
-	.write = perf_write,
+	.read_iter = perf_read,
+	.write_iter = perf_write,
 	.unlocked_ioctl = perf_ioctl,
 	.compat_ioctl = perf_ioctl,
 	.open = perf_open,
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ