* [PATCH 1/1] staging: media: atomisp: Disallow all private IOCTLSs but S_PARAMETERS
@ 2026-02-27 9:23 Sakari Ailus
2026-02-27 9:31 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2026-02-27 9:23 UTC (permalink / raw)
To: linux-media; +Cc: andy, hansg, mchehab, gregkh, linux-staging, Soufiane Dani
Disallow all private IOCTLs except ATOMISP_IOC_S_PARAMETERS. These aren't
quite as safe as one could assume of IOCTL handlers; disable them for now.
Instead of removing the code, simply check the IOCTL matches with
S_PARAMETERS and bail out otherwise, in order to ease backporting.
In particular, ATOMISP_IOC_S_ISP_FPN_TABLE is disabled by this patch.
Reported-by: Soufiane Dani <soufianeda@tutanota.com>
Closes: https://lore.kernel.org/linux-staging/20260210-atomisp-fix-v1-1-024429cbff31@tutanota.com/
Cc: stable@vger.kernel.org
Fixes: ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index a7f22de1c889..78e14c9aeed8 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -1356,6 +1356,10 @@ static int atomisp_s_parm(struct file *file, void *fh,
static long atomisp_vidioc_default(struct file *file, void *fh,
bool valid_prio, unsigned int cmd, void *arg)
{
+ /* Only allow ATOMISP_IOC_S_PARAMETERS for now! */
+ if (cmd != ATOMISP_IOC_S_PARAMETERS)
+ return -EINVAL;
+
struct video_device *vdev = video_devdata(file);
struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd;
int err;
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] staging: media: atomisp: Disallow all private IOCTLSs but S_PARAMETERS
2026-02-27 9:23 [PATCH 1/1] staging: media: atomisp: Disallow all private IOCTLSs but S_PARAMETERS Sakari Ailus
@ 2026-02-27 9:31 ` Andy Shevchenko
2026-02-27 10:54 ` Sakari Ailus
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2026-02-27 9:31 UTC (permalink / raw)
To: Sakari Ailus
Cc: linux-media, andy, hansg, mchehab, gregkh, linux-staging,
Soufiane Dani
On Fri, Feb 27, 2026 at 11:23:27AM +0200, Sakari Ailus wrote:
> Disallow all private IOCTLs except ATOMISP_IOC_S_PARAMETERS. These aren't
> quite as safe as one could assume of IOCTL handlers; disable them for now.
> Instead of removing the code, simply check the IOCTL matches with
> S_PARAMETERS and bail out otherwise, in order to ease backporting.
> In particular, ATOMISP_IOC_S_ISP_FPN_TABLE is disabled by this patch.
Why not removing the code?
It's still and will be in the Git index, it won't disappear.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] staging: media: atomisp: Disallow all private IOCTLSs but S_PARAMETERS
2026-02-27 9:31 ` Andy Shevchenko
@ 2026-02-27 10:54 ` Sakari Ailus
2026-02-28 10:52 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2026-02-27 10:54 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-media, andy, hansg, mchehab, gregkh, linux-staging,
Soufiane Dani
Hi Andy,
On Fri, Feb 27, 2026 at 11:31:29AM +0200, Andy Shevchenko wrote:
> On Fri, Feb 27, 2026 at 11:23:27AM +0200, Sakari Ailus wrote:
> > Disallow all private IOCTLs except ATOMISP_IOC_S_PARAMETERS. These aren't
> > quite as safe as one could assume of IOCTL handlers; disable them for now.
> > Instead of removing the code, simply check the IOCTL matches with
> > S_PARAMETERS and bail out otherwise, in order to ease backporting.
>
> > In particular, ATOMISP_IOC_S_ISP_FPN_TABLE is disabled by this patch.
>
> Why not removing the code?
> It's still and will be in the Git index, it won't disappear.
There have been changes in the IOCTL handler over the supported kernel
versions. This patch can be backported all the way down to v5.10.
I'm fine with removing the now-redundant code, but I'd rather do it
separtely from fixing the issue at hand.
--
Regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] staging: media: atomisp: Disallow all private IOCTLSs but S_PARAMETERS
2026-02-27 10:54 ` Sakari Ailus
@ 2026-02-28 10:52 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-02-28 10:52 UTC (permalink / raw)
To: Sakari Ailus
Cc: linux-media, andy, hansg, mchehab, gregkh, linux-staging,
Soufiane Dani
On Fri, Feb 27, 2026 at 12:54:26PM +0200, Sakari Ailus wrote:
> On Fri, Feb 27, 2026 at 11:31:29AM +0200, Andy Shevchenko wrote:
> > On Fri, Feb 27, 2026 at 11:23:27AM +0200, Sakari Ailus wrote:
> > > Disallow all private IOCTLs except ATOMISP_IOC_S_PARAMETERS. These aren't
> > > quite as safe as one could assume of IOCTL handlers; disable them for now.
> > > Instead of removing the code, simply check the IOCTL matches with
> > > S_PARAMETERS and bail out otherwise, in order to ease backporting.
> >
> > > In particular, ATOMISP_IOC_S_ISP_FPN_TABLE is disabled by this patch.
> >
> > Why not removing the code?
> > It's still and will be in the Git index, it won't disappear.
>
> There have been changes in the IOCTL handler over the supported kernel
> versions. This patch can be backported all the way down to v5.10.
>
> I'm fine with removing the now-redundant code, but I'd rather do it
> separtely from fixing the issue at hand.
Fair enough,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-28 10:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 9:23 [PATCH 1/1] staging: media: atomisp: Disallow all private IOCTLSs but S_PARAMETERS Sakari Ailus
2026-02-27 9:31 ` Andy Shevchenko
2026-02-27 10:54 ` Sakari Ailus
2026-02-28 10:52 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox