linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace
@ 2022-05-17  7:27 Jerome Pouiller
  2022-05-17  7:30 ` Christian König
  0 siblings, 1 reply; 6+ messages in thread
From: Jerome Pouiller @ 2022-05-17  7:27 UTC (permalink / raw)
  To: Daniel Vetter, Christian König, Jason Ekstrand, Pekka Paalanen
  Cc: linux-kernel, Jérôme Pouiller

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

The typedefs u32 and u64 are not available in userspace. Thus user get
an error he try to use DMA_BUF_SET_NAME_A or DMA_BUF_SET_NAME_B:

    $ gcc -Wall   -c -MMD -c -o ioctls_list.o ioctls_list.c
    In file included from /usr/include/x86_64-linux-gnu/asm/ioctl.h:1,
                     from /usr/include/linux/ioctl.h:5,
                     from /usr/include/asm-generic/ioctls.h:5,
                     from ioctls_list.c:11:
    ioctls_list.c:463:29: error: ‘u32’ undeclared here (not in a function)
      463 |     { "DMA_BUF_SET_NAME_A", DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h
          |                             ^~~~~~~~~~~~~~~~~~
    ioctls_list.c:464:29: error: ‘u64’ undeclared here (not in a function)
      464 |     { "DMA_BUF_SET_NAME_B", DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h
          |                             ^~~~~~~~~~~~~~~~~~

The issue was initially reported here[1].

[1]: https://github.com/jerome-pouiller/ioctl/pull/14

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 include/uapi/linux/dma-buf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/dma-buf.h b/include/uapi/linux/dma-buf.h
index 8e4a2ca0bcbf..b1523cb8ab30 100644
--- a/include/uapi/linux/dma-buf.h
+++ b/include/uapi/linux/dma-buf.h
@@ -92,7 +92,7 @@ struct dma_buf_sync {
  * between them in actual uapi, they're just different numbers.
  */
 #define DMA_BUF_SET_NAME	_IOW(DMA_BUF_BASE, 1, const char *)
-#define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, u32)
-#define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, u64)
+#define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, __u32)
+#define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, __u64)
 
 #endif
-- 
2.35.1


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

* Re: [PATCH] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace
  2022-05-17  7:27 [PATCH] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace Jerome Pouiller
@ 2022-05-17  7:30 ` Christian König
  2022-05-17  8:32   ` Jérôme Pouiller
  0 siblings, 1 reply; 6+ messages in thread
From: Christian König @ 2022-05-17  7:30 UTC (permalink / raw)
  To: Jerome Pouiller, Daniel Vetter, Jason Ekstrand, Pekka Paalanen
  Cc: linux-kernel

Am 17.05.22 um 09:27 schrieb Jerome Pouiller:
> From: Jérôme Pouiller <jerome.pouiller@silabs.com>
>
> The typedefs u32 and u64 are not available in userspace. Thus user get
> an error he try to use DMA_BUF_SET_NAME_A or DMA_BUF_SET_NAME_B:
>
>      $ gcc -Wall   -c -MMD -c -o ioctls_list.o ioctls_list.c
>      In file included from /usr/include/x86_64-linux-gnu/asm/ioctl.h:1,
>                       from /usr/include/linux/ioctl.h:5,
>                       from /usr/include/asm-generic/ioctls.h:5,
>                       from ioctls_list.c:11:
>      ioctls_list.c:463:29: error: ‘u32’ undeclared here (not in a function)
>        463 |     { "DMA_BUF_SET_NAME_A", DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h
>            |                             ^~~~~~~~~~~~~~~~~~
>      ioctls_list.c:464:29: error: ‘u64’ undeclared here (not in a function)
>        464 |     { "DMA_BUF_SET_NAME_B", DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h
>            |                             ^~~~~~~~~~~~~~~~~~
>
> The issue was initially reported here[1].
>
> [1]: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjerome-pouiller%2Fioctl%2Fpull%2F14&amp;data=05%7C01%7Cchristian.koenig%40amd.com%7C4b665e3c2222463014ec08da37d6b3f4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637883692533547283%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=prj%2BSOuf%2B1IWK1XKGD381LhDuL9qOoj7lYy8xMoV%2B6o%3D&amp;reserved=0
>
> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>

Good catch, Reviewed-by: Christian König <christian.koenig@amd.com>

CC: stable?
Fixes: ?

> ---
>   include/uapi/linux/dma-buf.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/dma-buf.h b/include/uapi/linux/dma-buf.h
> index 8e4a2ca0bcbf..b1523cb8ab30 100644
> --- a/include/uapi/linux/dma-buf.h
> +++ b/include/uapi/linux/dma-buf.h
> @@ -92,7 +92,7 @@ struct dma_buf_sync {
>    * between them in actual uapi, they're just different numbers.
>    */
>   #define DMA_BUF_SET_NAME	_IOW(DMA_BUF_BASE, 1, const char *)
> -#define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, u32)
> -#define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, u64)
> +#define DMA_BUF_SET_NAME_A	_IOW(DMA_BUF_BASE, 1, __u32)
> +#define DMA_BUF_SET_NAME_B	_IOW(DMA_BUF_BASE, 1, __u64)
>   
>   #endif


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

* Re: [PATCH] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace
  2022-05-17  7:30 ` Christian König
@ 2022-05-17  8:32   ` Jérôme Pouiller
  2022-05-17  9:37     ` Christian König
  2022-05-17  9:59     ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Jérôme Pouiller @ 2022-05-17  8:32 UTC (permalink / raw)
  To: Daniel Vetter, Jason Ekstrand, Pekka Paalanen, Christian König
  Cc: linux-kernel, stable

[add stable@vger.kernel.org to the recipients]

On Tuesday 17 May 2022 09:30:24 CEST Christian König wrote:
> Am 17.05.22 um 09:27 schrieb Jerome Pouiller:
> > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> >
> > The typedefs u32 and u64 are not available in userspace. Thus user get
> > an error he try to use DMA_BUF_SET_NAME_A or DMA_BUF_SET_NAME_B:
> >
> >      $ gcc -Wall   -c -MMD -c -o ioctls_list.o ioctls_list.c
> >      In file included from /usr/include/x86_64-linux-gnu/asm/ioctl.h:1,
> >                       from /usr/include/linux/ioctl.h:5,
> >                       from /usr/include/asm-generic/ioctls.h:5,
> >                       from ioctls_list.c:11:
> >      ioctls_list.c:463:29: error: ‘u32’ undeclared here (not in a function)
> >        463 |     { "DMA_BUF_SET_NAME_A", DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h
> >            |                             ^~~~~~~~~~~~~~~~~~
> >      ioctls_list.c:464:29: error: ‘u64’ undeclared here (not in a function)
> >        464 |     { "DMA_BUF_SET_NAME_B", DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h
> >            |                             ^~~~~~~~~~~~~~~~~~
> >
> > The issue was initially reported here[1].
> >
> > [1]: https://urldefense.com/v3/__https://nam11.safelinks.protection.outlook.com/?url=https*3A*2F*2Fgithub.com*2Fjerome-pouiller*2Fioctl*2Fpull*2F14&amp;data=05*7C01*7Cchristian.koenig*40amd.com*7C4b665e3c2222463014ec08da37d6b3f4*7C3dd8961fe4884e608e11a82d994e183d*7C0*7C0*7C637883692533547283*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C&amp;sdata=prj*2BSOuf*2B1IWK1XKGD381LhDuL9qOoj7lYy8xMoV*2B6o*3D&amp;reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSU!!N30Cs7Jr!Vp-6M6kuBq4uqEHaYTbkJbN3BTkd85DAeGS7xNYLPbNMp00kBlbD0iQPjJdQ5OVCFeCp_XVrsYIhxvLlpLQDmRhK5QXhQA$
> >
> > Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
> 
> Good catch, Reviewed-by: Christian König <christian.koenig@amd.com>
> 
> CC: stable?

Done

> Fixes: ?

Fixes: a5bff92eaac4 ("dma-buf: Fix SET_NAME ioctl uapi")

-- 
Jérôme Pouiller



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

* Re: [PATCH] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace
  2022-05-17  8:32   ` Jérôme Pouiller
@ 2022-05-17  9:37     ` Christian König
  2022-05-17 11:00       ` Jérôme Pouiller
  2022-05-17  9:59     ` Greg KH
  1 sibling, 1 reply; 6+ messages in thread
From: Christian König @ 2022-05-17  9:37 UTC (permalink / raw)
  To: Jérôme Pouiller, Daniel Vetter, Jason Ekstrand, Pekka Paalanen
  Cc: linux-kernel

Am 17.05.22 um 10:32 schrieb Jérôme Pouiller:
> [add stable@vger.kernel.org to the recipients]

Well, that's not what I suggested :)

The question was if we should add a CC stable tag while pushing this.

Greg might be complaining that you shouldn't CC the stable list manually.

> On Tuesday 17 May 2022 09:30:24 CEST Christian König wrote:
>> Am 17.05.22 um 09:27 schrieb Jerome Pouiller:
>>> From: Jérôme Pouiller <jerome.pouiller@silabs.com>
>>>
>>> The typedefs u32 and u64 are not available in userspace. Thus user get
>>> an error he try to use DMA_BUF_SET_NAME_A or DMA_BUF_SET_NAME_B:
>>>
>>>       $ gcc -Wall   -c -MMD -c -o ioctls_list.o ioctls_list.c
>>>       In file included from /usr/include/x86_64-linux-gnu/asm/ioctl.h:1,
>>>                        from /usr/include/linux/ioctl.h:5,
>>>                        from /usr/include/asm-generic/ioctls.h:5,
>>>                        from ioctls_list.c:11:
>>>       ioctls_list.c:463:29: error: ‘u32’ undeclared here (not in a function)
>>>         463 |     { "DMA_BUF_SET_NAME_A", DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h
>>>             |                             ^~~~~~~~~~~~~~~~~~
>>>       ioctls_list.c:464:29: error: ‘u64’ undeclared here (not in a function)
>>>         464 |     { "DMA_BUF_SET_NAME_B", DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h
>>>             |                             ^~~~~~~~~~~~~~~~~~
>>>
>>> The issue was initially reported here[1].
>>>
>>> [1]: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fnam11.safelinks.protection.outlook.com%2F%3Furl%3Dhttps*3A*2F*2Fgithub.com*2Fjerome-pouiller*2Fioctl*2Fpull*2F14%26amp%3Bdata%3D05*7C01*7Cchristian.koenig*40amd.com*7C4b665e3c2222463014ec08da37d6b3f4*7C3dd8961fe4884e608e11a82d994e183d*7C0*7C0*7C637883692533547283*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C%26amp%3Bsdata%3Dprj*2BSOuf*2B1IWK1XKGD381LhDuL9qOoj7lYy8xMoV*2B6o*3D%26amp%3Breserved%3D0__%3BJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSU!!N30Cs7Jr!Vp-6M6kuBq4uqEHaYTbkJbN3BTkd85DAeGS7xNYLPbNMp00kBlbD0iQPjJdQ5OVCFeCp_XVrsYIhxvLlpLQDmRhK5QXhQA%24&amp;data=05%7C01%7Cchristian.koenig%40amd.com%7Cfb9e2ca37e624de0ca6508da37dfc4cf%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637883731471453935%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=K1H3mVhehV9D1F9HleR%2FHWhN6NiQpAi5pXyF4RH4Kbw%3D&amp;reserved=0
>>>
>>> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
>> Good catch, Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>> CC: stable?
> Done
>
>> Fixes: ?
> Fixes: a5bff92eaac4 ("dma-buf: Fix SET_NAME ioctl uapi")

Going to push that to drm-misc-fixes with the Fixes: and CC: stable tag 
added.

Thanks,
Christian.



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

* Re: [PATCH] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace
  2022-05-17  8:32   ` Jérôme Pouiller
  2022-05-17  9:37     ` Christian König
@ 2022-05-17  9:59     ` Greg KH
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2022-05-17  9:59 UTC (permalink / raw)
  To: Jérôme Pouiller
  Cc: Daniel Vetter, Jason Ekstrand, Pekka Paalanen,
	Christian König, linux-kernel, stable

On Tue, May 17, 2022 at 10:32:15AM +0200, Jérôme Pouiller wrote:
> [add stable@vger.kernel.org to the recipients]
> 
> On Tuesday 17 May 2022 09:30:24 CEST Christian König wrote:
> > Am 17.05.22 um 09:27 schrieb Jerome Pouiller:
> > > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> > >
> > > The typedefs u32 and u64 are not available in userspace. Thus user get
> > > an error he try to use DMA_BUF_SET_NAME_A or DMA_BUF_SET_NAME_B:
> > >
> > >      $ gcc -Wall   -c -MMD -c -o ioctls_list.o ioctls_list.c
> > >      In file included from /usr/include/x86_64-linux-gnu/asm/ioctl.h:1,
> > >                       from /usr/include/linux/ioctl.h:5,
> > >                       from /usr/include/asm-generic/ioctls.h:5,
> > >                       from ioctls_list.c:11:
> > >      ioctls_list.c:463:29: error: ‘u32’ undeclared here (not in a function)
> > >        463 |     { "DMA_BUF_SET_NAME_A", DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h
> > >            |                             ^~~~~~~~~~~~~~~~~~
> > >      ioctls_list.c:464:29: error: ‘u64’ undeclared here (not in a function)
> > >        464 |     { "DMA_BUF_SET_NAME_B", DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h
> > >            |                             ^~~~~~~~~~~~~~~~~~
> > >
> > > The issue was initially reported here[1].
> > >
> > > [1]: https://urldefense.com/v3/__https://nam11.safelinks.protection.outlook.com/?url=https*3A*2F*2Fgithub.com*2Fjerome-pouiller*2Fioctl*2Fpull*2F14&amp;data=05*7C01*7Cchristian.koenig*40amd.com*7C4b665e3c2222463014ec08da37d6b3f4*7C3dd8961fe4884e608e11a82d994e183d*7C0*7C0*7C637883692533547283*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C&amp;sdata=prj*2BSOuf*2B1IWK1XKGD381LhDuL9qOoj7lYy8xMoV*2B6o*3D&amp;reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSU!!N30Cs7Jr!Vp-6M6kuBq4uqEHaYTbkJbN3BTkd85DAeGS7xNYLPbNMp00kBlbD0iQPjJdQ5OVCFeCp_XVrsYIhxvLlpLQDmRhK5QXhQA$
> > >
> > > Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
> > 
> > Good catch, Reviewed-by: Christian König <christian.koenig@amd.com>
> > 
> > CC: stable?
> 
> Done

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

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

* Re: [PATCH] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace
  2022-05-17  9:37     ` Christian König
@ 2022-05-17 11:00       ` Jérôme Pouiller
  0 siblings, 0 replies; 6+ messages in thread
From: Jérôme Pouiller @ 2022-05-17 11:00 UTC (permalink / raw)
  To: Daniel Vetter, Jason Ekstrand, Pekka Paalanen, Christian König
  Cc: linux-kernel

On Tuesday 17 May 2022 11:37:27 CEST Christian König wrote:
> Am 17.05.22 um 10:32 schrieb Jérôme Pouiller:
> > [add stable@vger.kernel.org to the recipients]
> 
> Well, that's not what I suggested :)
> 
> The question was if we should add a CC stable tag while pushing this.
> 
> Greg might be complaining that you shouldn't CC the stable list manually.

He did :). I was indeed unaware of this process.


> > On Tuesday 17 May 2022 09:30:24 CEST Christian König wrote:
> >> Am 17.05.22 um 09:27 schrieb Jerome Pouiller:
> >>> From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> >>>
> >>> The typedefs u32 and u64 are not available in userspace. Thus user get
> >>> an error he try to use DMA_BUF_SET_NAME_A or DMA_BUF_SET_NAME_B:
> >>>
> >>>       $ gcc -Wall   -c -MMD -c -o ioctls_list.o ioctls_list.c
> >>>       In file included from /usr/include/x86_64-linux-gnu/asm/ioctl.h:1,
> >>>                        from /usr/include/linux/ioctl.h:5,
> >>>                        from /usr/include/asm-generic/ioctls.h:5,
> >>>                        from ioctls_list.c:11:
> >>>       ioctls_list.c:463:29: error: ‘u32’ undeclared here (not in a function)
> >>>         463 |     { "DMA_BUF_SET_NAME_A", DMA_BUF_SET_NAME_A, -1, -1 }, // linux/dma-buf.h
> >>>             |                             ^~~~~~~~~~~~~~~~~~
> >>>       ioctls_list.c:464:29: error: ‘u64’ undeclared here (not in a function)
> >>>         464 |     { "DMA_BUF_SET_NAME_B", DMA_BUF_SET_NAME_B, -1, -1 }, // linux/dma-buf.h
> >>>             |                             ^~~~~~~~~~~~~~~~~~
> >>>
> >>> The issue was initially reported here[1].
> >>>
> >>>
> >>> Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
> >> Good catch, Reviewed-by: Christian König <christian.koenig@amd.com>
> >>
> >> CC: stable?
> > Done
> >
> >> Fixes: ?
> > Fixes: a5bff92eaac4 ("dma-buf: Fix SET_NAME ioctl uapi")
> 
> Going to push that to drm-misc-fixes with the Fixes: and CC: stable tag
> added.


-- 
Jérôme Pouiller



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

end of thread, other threads:[~2022-05-17 11:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17  7:27 [PATCH] dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace Jerome Pouiller
2022-05-17  7:30 ` Christian König
2022-05-17  8:32   ` Jérôme Pouiller
2022-05-17  9:37     ` Christian König
2022-05-17 11:00       ` Jérôme Pouiller
2022-05-17  9:59     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).