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

Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
 drivers/video/fbdev/pxa3xx-gcu.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 43c80316d84b..0890cea32df4 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -372,15 +372,13 @@ static int pxa3xx_gcu_open(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t
-pxa3xx_gcu_write(struct file *file, const char *buff,
-		 size_t count, loff_t *offp)
+static ssize_t pxa3xx_gcu_write(struct kiocb *iocb, struct iov_iter *from)
 {
 	int ret;
 	unsigned long flags;
 	struct pxa3xx_gcu_batch	*buffer;
-	struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);
-
+	struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(iocb->ki_filp);
+	size_t count = iov_iter_count(from);
 	size_t words = count / 4;
 
 	/* Does not need to be atomic. There's a lock in user space,
@@ -409,7 +407,7 @@ pxa3xx_gcu_write(struct file *file, const char *buff,
 
 
 	/* Copy data from user into buffer */
-	ret = copy_from_user(buffer->ptr, buff, words * 4);
+	ret = !copy_from_iter_full(buffer->ptr, words * 4, from);
 	if (ret) {
 		spin_lock_irqsave(&priv->spinlock, flags);
 		buffer->next = priv->free;
@@ -569,7 +567,7 @@ pxa3xx_gcu_free_buffers(struct device *dev,
 static const struct file_operations pxa3xx_gcu_miscdev_fops = {
 	.owner =		THIS_MODULE,
 	.open =			pxa3xx_gcu_open,
-	.write =		pxa3xx_gcu_write,
+	.write_iter =		pxa3xx_gcu_write,
 	.unlocked_ioctl =	pxa3xx_gcu_ioctl,
 	.mmap =			pxa3xx_gcu_mmap,
 };
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ