public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
@ 2018-07-24  8:32 Carlos Maiolino
  2018-07-30  8:58 ` Greg KH
  0 siblings, 1 reply; 11+ messages in thread
From: Carlos Maiolino @ 2018-07-24  8:32 UTC (permalink / raw)
  To: linux-arm-kernel

Fix several sparse warnings regarding different address space
assignments, like example below, by properly annotating pointers
expected to carry user space addresses.

warning: incorrect type in argument 1 (different address spaces)
Signed-off-by: Carlos Maiolino <cmaiolino28@gmail.com>
---

I'm not subscribed to the list, so, please, CC me on any reply.
Thanks a lot.

 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c   | 4 ++--
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

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 bc05c69383b8..42f471471e57 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -1648,8 +1648,8 @@ vchiq_compat_ioctl_queue_message(struct file *file,
 				 unsigned int cmd,
 				 unsigned long arg)
 {
-	VCHIQ_QUEUE_MESSAGE_T *args;
-	struct vchiq_element *elements;
+	VCHIQ_QUEUE_MESSAGE_T __user *args;
+	struct vchiq_element __user *elements;
 	struct vchiq_queue_message32 args32;
 	unsigned int count;
 
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
index 9f859953f45c..1776fab41e40 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
@@ -50,7 +50,7 @@ typedef struct {
 typedef struct {
 	unsigned int handle;
 	unsigned int count;
-	const struct vchiq_element *elements;
+	const struct vchiq_element __user *elements;
 } VCHIQ_QUEUE_MESSAGE_T;
 
 typedef struct {
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-24  8:32 [PATCH] staging/vc04_services: Use __user annotation for user-space pointers Carlos Maiolino
@ 2018-07-30  8:58 ` Greg KH
  2018-07-30  9:08   ` Carlos Maiolino
  0 siblings, 1 reply; 11+ messages in thread
From: Greg KH @ 2018-07-30  8:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jul 24, 2018 at 10:32:17AM +0200, Carlos Maiolino wrote:
> Fix several sparse warnings regarding different address space
> assignments, like example below, by properly annotating pointers
> expected to carry user space addresses.
> 
> warning: incorrect type in argument 1 (different address spaces)
> Signed-off-by: Carlos Maiolino <cmaiolino28@gmail.com>
> ---

We need a blank line befor your signed-off-by line please.

> I'm not subscribed to the list, so, please, CC me on any reply.
> Thanks a lot.
> 
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c   | 4 ++--
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> 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 bc05c69383b8..42f471471e57 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -1648,8 +1648,8 @@ vchiq_compat_ioctl_queue_message(struct file *file,
>  				 unsigned int cmd,
>  				 unsigned long arg)
>  {
> -	VCHIQ_QUEUE_MESSAGE_T *args;
> -	struct vchiq_element *elements;
> +	VCHIQ_QUEUE_MESSAGE_T __user *args;
> +	struct vchiq_element __user *elements;
>  	struct vchiq_queue_message32 args32;
>  	unsigned int count;
>  
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
> index 9f859953f45c..1776fab41e40 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
> @@ -50,7 +50,7 @@ typedef struct {
>  typedef struct {
>  	unsigned int handle;
>  	unsigned int count;
> -	const struct vchiq_element *elements;
> +	const struct vchiq_element __user *elements;
>  } VCHIQ_QUEUE_MESSAGE_T;
>  
>  typedef struct {

It would be great to have an ack from the maintainers here :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  8:58 ` Greg KH
@ 2018-07-30  9:08   ` Carlos Maiolino
  2018-07-30  9:13     ` Stefan Wahren
  2018-07-30  9:14     ` Greg KH
  0 siblings, 2 replies; 11+ messages in thread
From: Carlos Maiolino @ 2018-07-30  9:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 30, 2018 at 10:58 AM, Greg KH <greg@kroah.com> wrote:
> On Tue, Jul 24, 2018 at 10:32:17AM +0200, Carlos Maiolino wrote:
>> Fix several sparse warnings regarding different address space
>> assignments, like example below, by properly annotating pointers
>> expected to carry user space addresses.
>>
>> warning: incorrect type in argument 1 (different address spaces)
>> Signed-off-by: Carlos Maiolino <cmaiolino28@gmail.com>
>> ---
>
> We need a blank line befor your signed-off-by line please.
>

Thanks, I'll resend, or do you prefer me to way until this get a review from
the maintainer, and I resend the fixed description with the reviewed-by?


>> +     const struct vchiq_element __user *elements;
>>  } VCHIQ_QUEUE_MESSAGE_T;
>>
>>  typedef struct {
>
> It would be great to have an ack from the maintainers here :)
>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  9:08   ` Carlos Maiolino
@ 2018-07-30  9:13     ` Stefan Wahren
  2018-07-30  9:25       ` Carlos Maiolino
  2018-07-30  9:14     ` Greg KH
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Wahren @ 2018-07-30  9:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Carlos,


Am 30.07.2018 um 11:08 schrieb Carlos Maiolino:
> On Mon, Jul 30, 2018 at 10:58 AM, Greg KH <greg@kroah.com> wrote:
>> On Tue, Jul 24, 2018 at 10:32:17AM +0200, Carlos Maiolino wrote:
>>> Fix several sparse warnings regarding different address space
>>> assignments, like example below, by properly annotating pointers
>>> expected to carry user space addresses.
>>>
>>> warning: incorrect type in argument 1 (different address spaces)
>>> Signed-off-by: Carlos Maiolino <cmaiolino28@gmail.com>
>>> ---
>> We need a blank line befor your signed-off-by line please.
>>
> Thanks, I'll resend, or do you prefer me to way until this get a review from
> the maintainer, and I resend the fixed description with the reviewed-by?

did you test your patch via vchiq_test or something else?

Please add Eric Anholt and fix my mail address in the second version, i 
only received this via mailing list.

Stefan

>
>
>>> +     const struct vchiq_element __user *elements;
>>>   } VCHIQ_QUEUE_MESSAGE_T;
>>>
>>>   typedef struct {
>> It would be great to have an ack from the maintainers here :)
>>
>> thanks,
>>
>> greg k-h
> _______________________________________________
> linux-rpi-kernel mailing list
> linux-rpi-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  9:08   ` Carlos Maiolino
  2018-07-30  9:13     ` Stefan Wahren
@ 2018-07-30  9:14     ` Greg KH
  1 sibling, 0 replies; 11+ messages in thread
From: Greg KH @ 2018-07-30  9:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 30, 2018 at 11:08:06AM +0200, Carlos Maiolino wrote:
> On Mon, Jul 30, 2018 at 10:58 AM, Greg KH <greg@kroah.com> wrote:
> > On Tue, Jul 24, 2018 at 10:32:17AM +0200, Carlos Maiolino wrote:
> >> Fix several sparse warnings regarding different address space
> >> assignments, like example below, by properly annotating pointers
> >> expected to carry user space addresses.
> >>
> >> warning: incorrect type in argument 1 (different address spaces)
> >> Signed-off-by: Carlos Maiolino <cmaiolino28@gmail.com>
> >> ---
> >
> > We need a blank line befor your signed-off-by line please.
> >
> 
> Thanks, I'll resend, or do you prefer me to way until this get a review from
> the maintainer, and I resend the fixed description with the reviewed-by?

I should never have to hand-edit a patch, otherwise maintainers will not
scale, so yes, I need a new version.  But it would be great if we got a
review from the proper maintainers first so you know if anything else
needs to be done.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  9:13     ` Stefan Wahren
@ 2018-07-30  9:25       ` Carlos Maiolino
  2018-07-30  9:34         ` Stefan Wahren
  0 siblings, 1 reply; 11+ messages in thread
From: Carlos Maiolino @ 2018-07-30  9:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 30, 2018 at 11:13 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Hi Carlos,
>
>
> Am 30.07.2018 um 11:08 schrieb Carlos Maiolino:
>>
>> On Mon, Jul 30, 2018 at 10:58 AM, Greg KH <greg@kroah.com> wrote:
>>>
>>> On Tue, Jul 24, 2018 at 10:32:17AM +0200, Carlos Maiolino wrote:
>>>>
>>>> Fix several sparse warnings regarding different address space
>>>> assignments, like example below, by properly annotating pointers
>>>> expected to carry user space addresses.
>>>>
>>>> warning: incorrect type in argument 1 (different address spaces)
>>>> Signed-off-by: Carlos Maiolino <cmaiolino28@gmail.com>
>>>> ---
>>>
>>> We need a blank line befor your signed-off-by line please.
>>>
>> Thanks, I'll resend, or do you prefer me to way until this get a review
>> from
>> the maintainer, and I resend the fixed description with the reviewed-by?
>
>
> did you test your patch via vchiq_test or something else?
>

Hi, no. Can you please point me where I can get it?


> Please add Eric Anholt

Sure, will do

>and fix my mail address in the second version, i only
> received this via mailing list.
>

Meh, I shall use copy/paste next time :P
> Stefan
>
>>
>>
>>>> +     const struct vchiq_element __user *elements;
>>>>   } VCHIQ_QUEUE_MESSAGE_T;
>>>>
>>>>   typedef struct {
>>>
>>> It would be great to have an ack from the maintainers here :)
>>>
>>> thanks,
>>>
>>> greg k-h
>>
>> _______________________________________________
>> linux-rpi-kernel mailing list
>> linux-rpi-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  9:25       ` Carlos Maiolino
@ 2018-07-30  9:34         ` Stefan Wahren
  2018-07-30  9:43           ` Carlos Maiolino
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Wahren @ 2018-07-30  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Carlos,

Am 30.07.2018 um 11:25 schrieb Carlos Maiolino:
> On Mon, Jul 30, 2018 at 11:13 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>> Hi Carlos,
>>
>>
>> Am 30.07.2018 um 11:08 schrieb Carlos Maiolino:
>>> On Mon, Jul 30, 2018 at 10:58 AM, Greg KH <greg@kroah.com> wrote:
>>>> On Tue, Jul 24, 2018 at 10:32:17AM +0200, Carlos Maiolino wrote:
>>>>> Fix several sparse warnings regarding different address space
>>>>> assignments, like example below, by properly annotating pointers
>>>>> expected to carry user space addresses.
>>>>>
>>>>> warning: incorrect type in argument 1 (different address spaces)
>>>>> Signed-off-by: Carlos Maiolino <cmaiolino28@gmail.com>
>>>>> ---
>>>> We need a blank line befor your signed-off-by line please.
>>>>
>>> Thanks, I'll resend, or do you prefer me to way until this get a review
>>> from
>>> the maintainer, and I resend the fixed description with the reviewed-by?
>>
>> did you test your patch via vchiq_test or something else?
>>
> Hi, no. Can you please point me where I can get it?
>
>

i think easiest the way would be to get a recent Raspbian Lite ( 
https://www.raspberrypi.org/downloads/raspbian/ ),
build the kernel with bcm2835_defconfig, modify config.txt to use the 
upstream DTB, add the upstream kernel and DTB to boot partition.

The following command must be successful:

vchiq_test -f 1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  9:34         ` Stefan Wahren
@ 2018-07-30  9:43           ` Carlos Maiolino
  2018-07-30  9:49             ` Stefan Wahren
  0 siblings, 1 reply; 11+ messages in thread
From: Carlos Maiolino @ 2018-07-30  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 30, 2018 at 11:34 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Hi Carlos,
>
> Am 30.07.2018 um 11:25 schrieb Carlos Maiolino:
>>
>> On Mon, Jul 30, 2018 at 11:13 AM, Stefan Wahren <stefan.wahren@i2se.com>
>> wrote:
>>>
>>> Hi Carlos,
>>>
>>>
>>> Am 30.07.2018 um 11:08 schrieb Carlos Maiolino:
>>>>
>>>> On Mon, Jul 30, 2018 at 10:58 AM, Greg KH <greg@kroah.com> wrote:
>>>>>
>>>>> On Tue, Jul 24, 2018 at 10:32:17AM +0200, Carlos Maiolino wrote:
>>>>>>
>>>>>> Fix several sparse warnings regarding different address space
>>>>>> assignments, like example below, by properly annotating pointers
>>>>>> expected to carry user space addresses.
>>>>>>
>>>>>> warning: incorrect type in argument 1 (different address spaces)
>>>>>> Signed-off-by: Carlos Maiolino <cmaiolino28@gmail.com>
>>>>>> ---
>>>>>
>>>>> We need a blank line befor your signed-off-by line please.
>>>>>
>>>> Thanks, I'll resend, or do you prefer me to way until this get a review
>>>> from
>>>> the maintainer, and I resend the fixed description with the reviewed-by?
>>>
>>>
>>> did you test your patch via vchiq_test or something else?
>>>
>> Hi, no. Can you please point me where I can get it?
>>
>>
>
> i think easiest the way would be to get a recent Raspbian Lite (
> https://www.raspberrypi.org/downloads/raspbian/ ),
> build the kernel with bcm2835_defconfig, modify config.txt to use the
> upstream DTB, add the upstream kernel and DTB to boot partition.
>
> The following command must be successful:
>
> vchiq_test -f 1

K, I'll take a look and find a way to test it, I don't have a rPI at
the moment to test
it, I'll take a look if I can borrow one. in mean time, can it be
tested somehow in x86 environment?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  9:43           ` Carlos Maiolino
@ 2018-07-30  9:49             ` Stefan Wahren
  2018-07-30  9:57               ` Carlos Maiolino
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Wahren @ 2018-07-30  9:49 UTC (permalink / raw)
  To: linux-arm-kernel

Am 30.07.2018 um 11:43 schrieb Carlos Maiolino:
> On Mon, Jul 30, 2018 at 11:34 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>> i think easiest the way would be to get a recent Raspbian Lite (
>> https://www.raspberrypi.org/downloads/raspbian/ ),
>> build the kernel with bcm2835_defconfig, modify config.txt to use the
>> upstream DTB, add the upstream kernel and DTB to boot partition.
>>
>> The following command must be successful:
>>
>> vchiq_test -f 1
> K, I'll take a look and find a way to test it, I don't have a rPI at
> the moment to test
> it, I'll take a look if I can borrow one. in mean time, can it be
> tested somehow in x86 environment?

I don't see a chance because this driver talks to the VC4 firmware.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  9:49             ` Stefan Wahren
@ 2018-07-30  9:57               ` Carlos Maiolino
  2018-08-03 16:05                 ` Stefan Wahren
  0 siblings, 1 reply; 11+ messages in thread
From: Carlos Maiolino @ 2018-07-30  9:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 30, 2018 at 11:49 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Am 30.07.2018 um 11:43 schrieb Carlos Maiolino:
>> On Mon, Jul 30, 2018 at 11:34 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>>> i think easiest the way would be to get a recent Raspbian Lite (
>>> https://www.raspberrypi.org/downloads/raspbian/ ),
>>> build the kernel with bcm2835_defconfig, modify config.txt to use the
>>> upstream DTB, add the upstream kernel and DTB to boot partition.
>>>
>>> The following command must be successful:
>>>
>>> vchiq_test -f 1
>> K, I'll take a look and find a way to test it, I don't have a rPI at
>> the moment to test
>> it, I'll take a look if I can borrow one. in mean time, can it be
>> tested somehow in x86 environment?
>
> I don't see a chance because this driver talks to the VC4 firmware.
>

kk

thx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] staging/vc04_services: Use __user annotation for user-space pointers
  2018-07-30  9:57               ` Carlos Maiolino
@ 2018-08-03 16:05                 ` Stefan Wahren
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Wahren @ 2018-08-03 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Carlos,

> Carlos Maiolino <cmaiolino28@gmail.com> hat am 30. Juli 2018 um 11:57 geschrieben:
> 
> 
> On Mon, Jul 30, 2018 at 11:49 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> > Am 30.07.2018 um 11:43 schrieb Carlos Maiolino:
> >> On Mon, Jul 30, 2018 at 11:34 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> >>> i think easiest the way would be to get a recent Raspbian Lite (
> >>> https://www.raspberrypi.org/downloads/raspbian/ ),
> >>> build the kernel with bcm2835_defconfig, modify config.txt to use the
> >>> upstream DTB, add the upstream kernel and DTB to boot partition.
> >>>
> >>> The following command must be successful:
> >>>
> >>> vchiq_test -f 1
> >> K, I'll take a look and find a way to test it, I don't have a rPI at
> >> the moment to test
> >> it, I'll take a look if I can borrow one. in mean time, can it be
> >> tested somehow in x86 environment?
> >
> > I don't see a chance because this driver talks to the VC4 firmware.
> >
> 
> kk
> 
> thx

i only want to point out that there was a regression (deadlock) in linux-next, which has been reverted [1] / fixed.

[1] - https://lkml.org/lkml/2018/8/2/578

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-08-03 16:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-24  8:32 [PATCH] staging/vc04_services: Use __user annotation for user-space pointers Carlos Maiolino
2018-07-30  8:58 ` Greg KH
2018-07-30  9:08   ` Carlos Maiolino
2018-07-30  9:13     ` Stefan Wahren
2018-07-30  9:25       ` Carlos Maiolino
2018-07-30  9:34         ` Stefan Wahren
2018-07-30  9:43           ` Carlos Maiolino
2018-07-30  9:49             ` Stefan Wahren
2018-07-30  9:57               ` Carlos Maiolino
2018-08-03 16:05                 ` Stefan Wahren
2018-07-30  9:14     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox