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-64-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:13:23 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 063/437] sound/oss/dmasound: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 sound/oss/dmasound/dmasound_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index 164335d3c200..c702a8c5c668 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -1334,15 +1334,15 @@ static int state_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t state_read(struct file *file, char __user *buf, size_t count,
-			  loff_t *ppos)
+static ssize_t state_read(struct kiocb *iocb, struct iov_iter *to)
 {
+	size_t count = iov_iter_count(to);
 	int n = state.len - state.ptr;
 	if (n > count)
 		n = count;
 	if (n <= 0)
 		return 0;
-	if (copy_to_user(buf, &state.buf[state.ptr], n))
+	if (!copy_to_iter_full(&state.buf[state.ptr], n, to))
 		return -EFAULT;
 	state.ptr += n;
 	return n;
@@ -1351,7 +1351,7 @@ static ssize_t state_read(struct file *file, char __user *buf, size_t count,
 static const struct file_operations state_fops = {
 	.owner		= THIS_MODULE,
 	.llseek		= no_llseek,
-	.read		= state_read,
+	.read_iter	= state_read,
 	.open		= state_open,
 	.release	= state_release,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ