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

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

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 365e6ddbe90f..b7afc48ab39c 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -772,8 +772,7 @@ static bool check_can_switch(void)
 }
 
 static ssize_t
-vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
-			     size_t cnt, loff_t *ppos)
+vga_switcheroo_debugfs_write(struct kiocb *iocb, struct iov_iter *from)
 {
 	char usercmd[64];
 	int ret;
@@ -781,11 +780,12 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 	bool just_mux = false;
 	enum vga_switcheroo_client_id client_id = VGA_SWITCHEROO_UNKNOWN_ID;
 	struct vga_switcheroo_client *client = NULL;
+	size_t cnt = iov_iter_count(from);
 
 	if (cnt > 63)
 		cnt = 63;
 
-	if (copy_from_user(usercmd, ubuf, cnt))
+	if (!copy_from_iter_full(usercmd, cnt, from))
 		return -EFAULT;
 
 	mutex_lock(&vgasr_mutex);
@@ -899,8 +899,8 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 static const struct file_operations vga_switcheroo_debugfs_fops = {
 	.owner = THIS_MODULE,
 	.open = vga_switcheroo_debugfs_open,
-	.write = vga_switcheroo_debugfs_write,
-	.read = seq_read,
+	.write_iter = vga_switcheroo_debugfs_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