Skip to contentSkip to conversation

staging: media: atomisp: Disallow all private IOCTLs

PATCH In review Sakari Ailus 3 participants 7 messages Mar 3 – Mar 4

Subsystems (4)
lore
Share & tools
lore

Sakari Ailus

author reviewer
#0 lore raw

PATCH 1/1 staging: media: atomisp: Disallow all private IOCTLs

Disallow all private IOCTLs. These aren't quite as safe as one could assume of IOCTL handlers; disable them for now. Instead of removing the code, return in the beginning of the function if cmd is non-zero in order to keep static checkers happy.

Fixes ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")
---
 drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +4 -0
index a7f22de1c889..50366bf10f32 100644
@@ -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)
 {
+	/* Disable all private IOCTLs for now! */
+	if (cmd)
+		return -EINVAL;
+
 	struct video_device *vdev = video_devdata(file);
 	struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd;
 	int err;
Signature · 1 line
2.47.3
#1 lore raw
Quoted 11 lines · Sakari Ailus

Disallow all private IOCTLs. These aren't quite as safe as one could assume of IOCTL handlers; disable them for now. Instead of removing the code, return in the beginning of the function if cmd is non-zero in order to keep static checkers happy.

Fixes ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")

Is it the correct one? Driver was before that, so I believe this needs to go deeper.

...

drivers/staging/media/atomisp/pci/atomisp_ioctl.c static int atomisp_s_parm(struct file *file, void *fh, · line 1361

Quoted 3 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +3 -0
+       /* Disable all private IOCTLs for now! */
+       if (cmd)
+               return -EINVAL;

Maybe even a warning?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author reviewer
#2 lore raw

Hi Andy,

Quoted 8 lines · Andy Shevchenko
Quoted 6 lines · Sakari Ailus

Disallow all private IOCTLs. These aren't quite as safe as one could assume of IOCTL handlers; disable them for now. Instead of removing the code, return in the beginning of the function if cmd is non-zero in order to keep static checkers happy.

Quoted 8 lines
Quoted 5 lines
Fixes ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")

Is it the correct one? Driver was before that, so I believe this needs to go deeper.

Technically yes, but even this one is from 2020 and the patch removing it was merged in 2018, for v4.18. These aren't supported anymore.

Quoted 8 lines

...

drivers/staging/media/atomisp/pci/atomisp_ioctl.c static int atomisp_s_parm(struct file *file, void *fh, · line 1361

Quoted 3 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +3 -0
+       /* Disable all private IOCTLs for now! */
+       if (cmd)
+               return -EINVAL;

Maybe even a warning?

That'd be just filling the logs, wouldn't it?

Quoted 1 line
Signature · 3 lines
Regards,

Sakari Ailus
#3 lore raw
Quoted 13 lines · Sakari Ailus
Quoted 12 lines · Andy Shevchenko
Quoted 9 lines · Sakari Ailus

Disallow all private IOCTLs. These aren't quite as safe as one could assume of IOCTL handlers; disable them for now. Instead of removing the code, return in the beginning of the function if cmd is non-zero in order to keep static checkers happy.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Fixes ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")

Is it the correct one? Driver was before that, so I believe this needs to go deeper.

Technically yes, but even this one is from 2020 and the patch removing it was merged in 2018, for v4.18. These aren't supported anymore.

It doesn't matter, the Fixes should be correct one, the Revert patch is not the initial one where the code appeared.

...

Quoted 7 lines
Quoted 5 lines

drivers/staging/media/atomisp/pci/atomisp_ioctl.c static int atomisp_s_parm(struct file *file, void *fh, · line 1361

Quoted 3 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +3 -0
+       /* Disable all private IOCTLs for now! */
+       if (cmd)
+               return -EINVAL;

Maybe even a warning?

That'd be just filling the logs, wouldn't it?

dev_warn_once()

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author reviewer
#4 lore raw

Hi Andy,

Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Sakari Ailus
Quoted 14 lines · Andy Shevchenko
Quoted 11 lines · Sakari Ailus

Disallow all private IOCTLs. These aren't quite as safe as one could assume of IOCTL handlers; disable them for now. Instead of removing the code, return in the beginning of the function if cmd is non-zero in order to keep static checkers happy.

Fixes ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Is it the correct one? Driver was before that, so I believe this needs to go deeper.

Technically yes, but even this one is from 2020 and the patch removing it was merged in 2018, for v4.18. These aren't supported anymore.

It doesn't matter, the Fixes should be correct one, the Revert patch is not the initial one where the code appeared.

Both patches actually separately introduce the bug. I'll use both Fixes:
tags then.

Quoted 7 lines

...

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +3 -0
+       /* Disable all private IOCTLs for now! */
+       if (cmd)
+               return -EINVAL;
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Maybe even a warning?

That'd be just filling the logs, wouldn't it?

dev_warn_once()

Would that warning be useful? We don't warn about other unsupported IOCTLs either...

Signature · 1 line
Sakari Ailus
#5 lore raw
Quoted 5 lines · Sakari Ailus
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Sakari Ailus
Quoted 2 lines · Andy Shevchenko

On Tue, Mar 3, 2026 at 10:34 AM Sakari Ailus
<[email protected]> wrote:

...

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Fixes ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")

Is it the correct one? Driver was before that, so I believe this needs to go deeper.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Technically yes, but even this one is from 2020 and the patch removing it was merged in 2018, for v4.18. These aren't supported anymore.

It doesn't matter, the Fixes should be correct one, the Revert patch is not the initial one where the code appeared.

Both patches actually separately introduce the bug. I'll use both Fixes:
tags then.

WFM, thanks!

...

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +3 -0
+       /* Disable all private IOCTLs for now! */
+       if (cmd)
+               return -EINVAL;
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Maybe even a warning?

That'd be just filling the logs, wouldn't it?

dev_warn_once()

Would that warning be useful? We don't warn about other unsupported IOCTLs either...

The question here: will it be helpful to speedup / motivate moving users to the standard IOCTLs? If not, no need.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author reviewer
#6 lore raw

Hi Andy,

Quoted 36 lines · Andy Shevchenko
Quoted 5 lines · Sakari Ailus
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Sakari Ailus
Quoted 2 lines · Andy Shevchenko

On Tue, Mar 3, 2026 at 10:34 AM Sakari Ailus
<[email protected]> wrote:

...

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
Fixes ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")

Is it the correct one? Driver was before that, so I believe this needs to go deeper.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Technically yes, but even this one is from 2020 and the patch removing it was merged in 2018, for v4.18. These aren't supported anymore.

It doesn't matter, the Fixes should be correct one, the Revert patch is not the initial one where the code appeared.

Both patches actually separately introduce the bug. I'll use both Fixes:
tags then.

WFM, thanks!

...

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

drivers/staging/media/atomisp/pci/atomisp_ioctl.c static int atomisp_s_parm(struct file *file, void *fh, · line 1361

Quoted 3 lines
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +3 -0
+       /* Disable all private IOCTLs for now! */
+       if (cmd)
+               return -EINVAL;

Maybe even a warning?

That'd be just filling the logs, wouldn't it?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

dev_warn_once()

Would that warning be useful? We don't warn about other unsupported IOCTLs either...

The question here: will it be helpful to speedup / motivate moving users to the standard IOCTLs? If not, no need.

It won't: you can't set the IPU processing block parameters with private IOCTLs disabled.

Signature · 4 lines
Kind regards,


Sakari Ailus