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-387-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:18:46 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 386/437] EDAC/versal: convert to read/write iterators

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/edac/versal_edac.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/edac/versal_edac.c b/drivers/edac/versal_edac.c
index 1688a5050f63..bd3abd3598ba 100644
--- a/drivers/edac/versal_edac.c
+++ b/drivers/edac/versal_edac.c
@@ -781,16 +781,16 @@ static void xddr_inject_data_ce_store(struct mem_ctl_info *mci, u8 ce_bitpos)
  *
  * Upon doing a read to the address the errors are injected.
  */
-static ssize_t inject_data_ce_store(struct file *file, const char __user *data,
-				    size_t count, loff_t *ppos)
+static ssize_t inject_data_ce_store(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct device *dev = file->private_data;
+	struct device *dev = iocb->ki_filp->private_data;
 	struct mem_ctl_info *mci = to_mci(dev);
 	struct edac_priv *priv = mci->pvt_info;
+	size_t count = iov_iter_count(from);
 	u8 ce_bitpos;
 	int ret;
 
-	ret = kstrtou8_from_user(data, count, 0, &ce_bitpos);
+	ret = kstrtou8_from_iter(from, count, 0, &ce_bitpos);
 	if (ret)
 		return ret;
 
@@ -812,7 +812,7 @@ static ssize_t inject_data_ce_store(struct file *file, const char __user *data,
 
 static const struct file_operations xddr_inject_ce_fops = {
 	.open = simple_open,
-	.write = inject_data_ce_store,
+	.write_iter = inject_data_ce_store,
 	.llseek = generic_file_llseek,
 };
 
@@ -845,19 +845,19 @@ static void xddr_inject_data_ue_store(struct mem_ctl_info *mci, u32 val0, u32 va
  *
  * Upon doing a read to the address the errors are injected.
  */
-static ssize_t inject_data_ue_store(struct file *file, const char __user *data,
-				    size_t count, loff_t *ppos)
+static ssize_t inject_data_ue_store(struct kiocb *iocb, struct iov_iter *from)
 {
-	struct device *dev = file->private_data;
+	struct device *dev = iocb->ki_filp->private_data;
 	struct mem_ctl_info *mci = to_mci(dev);
 	struct edac_priv *priv = mci->pvt_info;
+	size_t count = iov_iter_count(from);
 	char buf[6], *pbuf, *token[2];
 	u32 val0 = 0, val1 = 0;
 	u8 len, ue0, ue1;
 	int i, ret;
 
 	len = min_t(size_t, count, sizeof(buf));
-	if (copy_from_user(buf, data, len))
+	if (!copy_from_iter_full(from, len, from))
 		return -EFAULT;
 
 	buf[len] = '\0';
@@ -903,7 +903,7 @@ static ssize_t inject_data_ue_store(struct file *file, const char __user *data,
 
 static const struct file_operations xddr_inject_ue_fops = {
 	.open = simple_open,
-	.write = inject_data_ue_store,
+	.write_iter = inject_data_ue_store,
 	.llseek = generic_file_llseek,
 };
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ