* [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls
@ 2017-05-30 14:11 Gleb Fotengauer-Malinovskiy
2017-05-30 23:33 ` Laura Abbott
0 siblings, 1 reply; 5+ messages in thread
From: Gleb Fotengauer-Malinovskiy @ 2017-05-30 14:11 UTC (permalink / raw)
To: Laura Abbott, linux-kernel
Cc: Sumit Semwal, Greg Kroah-Hartman, Arve Hjønnevåg,
Riley Andrews, devel, Dmitry V. Levin
This problem was found by strace ioctl list generator.
Fixes: 15c6098cfec5 ("staging: android: ion: Remove ion_handle and ion_client")
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
---
drivers/staging/android/uapi/ion.h | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/drivers/staging/android/uapi/ion.h b/drivers/staging/android/uapi/ion.h
index b76db1b..a291b12 100644
--- a/drivers/staging/android/uapi/ion.h
+++ b/drivers/staging/android/uapi/ion.h
@@ -131,24 +131,6 @@ struct ion_heap_query {
struct ion_allocation_data)
/**
- * DOC: ION_IOC_FREE - free memory
- *
- * Takes an ion_handle_data struct and frees the handle.
- */
-#define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data)
-
-/**
- * DOC: ION_IOC_SHARE - creates a file descriptor to use to share an allocation
- *
- * Takes an ion_fd_data struct with the handle field populated with a valid
- * opaque handle. Returns the struct with the fd field set to a file
- * descriptor open in the current address space. This file descriptor
- * can then be passed to another process. The corresponding opaque handle can
- * be retrieved via ION_IOC_IMPORT.
- */
-#define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data)
-
-/**
* DOC: ION_IOC_HEAP_QUERY - information about available heaps
*
* Takes an ion_heap_query structure and populates information about
--
glebfm
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls
2017-05-30 14:11 [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls Gleb Fotengauer-Malinovskiy
@ 2017-05-30 23:33 ` Laura Abbott
2017-06-13 18:17 ` Gleb Fotengauer-Malinovskiy
0 siblings, 1 reply; 5+ messages in thread
From: Laura Abbott @ 2017-05-30 23:33 UTC (permalink / raw)
To: Gleb Fotengauer-Malinovskiy, linux-kernel
Cc: Sumit Semwal, Greg Kroah-Hartman, Arve Hjønnevåg,
Riley Andrews, devel, Dmitry V. Levin
On 05/30/2017 07:11 AM, Gleb Fotengauer-Malinovskiy wrote:
> This problem was found by strace ioctl list generator.
>
> Fixes: 15c6098cfec5 ("staging: android: ion: Remove ion_handle and ion_client")
> Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
> ---
> drivers/staging/android/uapi/ion.h | 18 ------------------
> 1 file changed, 18 deletions(-)
>
> diff --git a/drivers/staging/android/uapi/ion.h b/drivers/staging/android/uapi/ion.h
> index b76db1b..a291b12 100644
> --- a/drivers/staging/android/uapi/ion.h
> +++ b/drivers/staging/android/uapi/ion.h
> @@ -131,24 +131,6 @@ struct ion_heap_query {
> struct ion_allocation_data)
>
> /**
> - * DOC: ION_IOC_FREE - free memory
> - *
> - * Takes an ion_handle_data struct and frees the handle.
> - */
> -#define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data)
> -
> -/**
> - * DOC: ION_IOC_SHARE - creates a file descriptor to use to share an allocation
> - *
> - * Takes an ion_fd_data struct with the handle field populated with a valid
> - * opaque handle. Returns the struct with the fd field set to a file
> - * descriptor open in the current address space. This file descriptor
> - * can then be passed to another process. The corresponding opaque handle can
> - * be retrieved via ION_IOC_IMPORT.
> - */
> -#define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data)
> -
> -/**
> * DOC: ION_IOC_HEAP_QUERY - information about available heaps
> *
> * Takes an ion_heap_query structure and populates information about
>
Acked-by: Laura Abbott <labbott@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls
2017-05-30 23:33 ` Laura Abbott
@ 2017-06-13 18:17 ` Gleb Fotengauer-Malinovskiy
2017-06-14 5:08 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Gleb Fotengauer-Malinovskiy @ 2017-06-13 18:17 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Laura Abbott, linux-kernel, Sumit Semwal,
Arve Hjønnevåg, Riley Andrews, devel, Dmitry V. Levin
On Tue, May 30, 2017 at 04:33:57PM -0700, Laura Abbott wrote:
> On 05/30/2017 07:11 AM, Gleb Fotengauer-Malinovskiy wrote:
> > This problem was found by strace ioctl list generator.
> >
> > Fixes: 15c6098cfec5 ("staging: android: ion: Remove ion_handle and ion_client")
As this commit fixes a regression, please apply it to the tree which will
be merged before 4.12 release, too.
Otherwise the regression will be introduced to the release.
--
glebfm
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls
2017-06-13 18:17 ` Gleb Fotengauer-Malinovskiy
@ 2017-06-14 5:08 ` Greg Kroah-Hartman
2017-06-14 15:48 ` Dmitry V. Levin
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-14 5:08 UTC (permalink / raw)
To: Gleb Fotengauer-Malinovskiy
Cc: Laura Abbott, linux-kernel, Sumit Semwal,
Arve Hjønnevåg, Riley Andrews, devel, Dmitry V. Levin
On Tue, Jun 13, 2017 at 09:17:05PM +0300, Gleb Fotengauer-Malinovskiy wrote:
> On Tue, May 30, 2017 at 04:33:57PM -0700, Laura Abbott wrote:
> > On 05/30/2017 07:11 AM, Gleb Fotengauer-Malinovskiy wrote:
> > > This problem was found by strace ioctl list generator.
> > >
> > > Fixes: 15c6098cfec5 ("staging: android: ion: Remove ion_handle and ion_client")
>
> As this commit fixes a regression, please apply it to the tree which will
> be merged before 4.12 release, too.
What "regression" is there? The fact that a staging driver has a few
spare ioctls floating around in a header file? How is that bad?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls
2017-06-14 5:08 ` Greg Kroah-Hartman
@ 2017-06-14 15:48 ` Dmitry V. Levin
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry V. Levin @ 2017-06-14 15:48 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Gleb Fotengauer-Malinovskiy, Laura Abbott, linux-kernel,
Sumit Semwal, Arve Hjønnevåg, Riley Andrews, devel
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]
On Wed, Jun 14, 2017 at 07:08:39AM +0200, Greg Kroah-Hartman wrote:
> On Tue, Jun 13, 2017 at 09:17:05PM +0300, Gleb Fotengauer-Malinovskiy wrote:
> > On Tue, May 30, 2017 at 04:33:57PM -0700, Laura Abbott wrote:
> > > On 05/30/2017 07:11 AM, Gleb Fotengauer-Malinovskiy wrote:
> > > > This problem was found by strace ioctl list generator.
> > > >
> > > > Fixes: 15c6098cfec5 ("staging: android: ion: Remove ion_handle and ion_client")
> >
> > As this commit fixes a regression, please apply it to the tree which will
> > be merged before 4.12 release, too.
>
> What "regression" is there? The fact that a staging driver has a few
> spare ioctls floating around in a header file? How is that bad?
I thought it was pretty obvious.
OK, here is a bit more detailed explanation.
There is an uapi header that after commit 15c6098cfec5 provides
definitions of ioctl macros that do not compile when used.
Imagine a userspace code that does something as harmless as
#ifdef ION_IOC_FREE
use(ION_IOC_FREE);
#endif
This simple code is broken by commit 15c6098cfec5.
The regression is not a pure virtual one, there is a quite real userspace
(strace ioctl list generator) broken by the change.
--
ldv
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-06-14 15:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-30 14:11 [PATCH] staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls Gleb Fotengauer-Malinovskiy
2017-05-30 23:33 ` Laura Abbott
2017-06-13 18:17 ` Gleb Fotengauer-Malinovskiy
2017-06-14 5:08 ` Greg Kroah-Hartman
2017-06-14 15:48 ` Dmitry V. Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox