Re: [PATCH] staging: vchiq: Avoid mixing bulk_userdata kernel and userspace pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Umang,

Am 30.07.24 um 19:08 schrieb Umang Jain:
In vchiq_dev.c, there are two places where the __user bulk_userdata
pointer to set to a kernel-space pointer which then gives relevant
Sparse warnings as below:

vchiq_dev.c:328:26: warning: incorrect type in assignment (different address spaces)
vchiq_dev.c:328:26:    expected void *[assigned] userdata
vchiq_dev.c:328:26:    got void [noderef] __user *userdata
vchiq_dev.c:543:47: warning: incorrect type in assignment (different address spaces)
vchiq_dev.c:543:47:    expected void [noderef] __user *[addressable] [assigned] bulk_userdata
vchiq_dev.c:543:47:    got void *bulk_userdata

This is solved by adding additional functional argument to track the
userspace bulk_userdata separately and passing it accordingly to
completion handlers.
IMO this patch fixes the issue for spare, but don't address the
confusing member naming for humans. It's not clear that "userdata" is a
kernel pointer and "uuserdata" is a pointer to userspace. It would be
nice to avoid the word "user" for kernel pointer in this case.

Thanks





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux