public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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