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]
Date: Thu, 11 Apr 2024 09:15:50 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 210/437] drivers/iommu: convert intel iommu to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/iommu/intel/debugfs.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index 86b506af7daa..8655098a3a17 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -679,19 +679,19 @@ static int dmar_perf_latency_open(struct inode *inode, struct file *filp)
 	return single_open(filp, latency_show, NULL);
 }
 
-static ssize_t dmar_perf_latency_write(struct file *filp,
-				       const char __user *ubuf,
-				       size_t cnt, loff_t *ppos)
+static ssize_t dmar_perf_latency_write(struct kiocb *iocb,
+				       struct iov_iter *from)
 {
 	struct dmar_drhd_unit *drhd;
 	struct intel_iommu *iommu;
+	size_t cnt = iov_iter_count(from);
 	int counting;
 	char buf[64];
 
 	if (cnt > 63)
 		cnt = 63;
 
-	if (copy_from_user(&buf, ubuf, cnt))
+	if (!copy_from_iter_full(&buf, cnt, from))
 		return -EFAULT;
 
 	buf[cnt] = 0;
@@ -738,14 +738,14 @@ static ssize_t dmar_perf_latency_write(struct file *filp,
 		return -EINVAL;
 	}
 
-	*ppos += cnt;
+	iocb->ki_pos += cnt;
 	return cnt;
 }
 
 static const struct file_operations dmar_perf_latency_fops = {
 	.open		= dmar_perf_latency_open,
-	.write		= dmar_perf_latency_write,
-	.read		= seq_read,
+	.write_iter	= dmar_perf_latency_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