[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210522053429.82710-1-phind.uet@gmail.com>
Date: Sat, 22 May 2021 13:34:29 +0800
From: Nguyen Dinh Phi <phind.uet@...il.com>
To: nsaenz@...nel.org, gregkh@...uxfoundation.org,
stefan.wahren@...e.com, arnd@...db.de, dan.carpenter@...cle.com,
phil@...pberrypi.com, amarjargal16@...il.com
Cc: bcm-kernel-feedback-list@...adcom.com,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: vchiq_arm: Using copy_from_user() to copy data from userspace address
This commit to fix the following sparse warning:
incorrect type in assignment (different address spaces)
expected void *[assigned] userdata
got void [noderef] __user *userdata
Signed-off-by: Nguyen Dinh Phi <phind.uet@...il.com>
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index afbf01b7364c..2a4fc599f977 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -960,7 +960,10 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
current->pid);
userdata = &waiter->bulk_waiter;
} else {
- userdata = args->userdata;
+ if (copy_from_user(userdata, args->userdata, sizeof(args->userdata))) {
+ ret = -EFAULT;
+ goto out;
+ }
}
status = vchiq_bulk_transfer(args->handle, NULL, args->data, args->size,
--
2.25.1
Powered by blists - more mailing lists