staging: media: atomisp: Disallow all private IOCTLSs but S_PARAMETERS
Subsystems (4)
Sakari Ailus
reviewerPATCH 1/1 staging: media: atomisp: Disallow all private IOCTLSs but S_PARAMETERS
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.
--- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/staging/media/atomisp/pci/atomisp_ioctl.c +4 -0
@@ -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;
Signature · 1 line
2.47.3
Quoted 6 lines · Sakari Ailus
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 withS_PARAMETERSand bail out otherwise, in order to ease backporting.In particular,
ATOMISP_IOC_S_ISP_FPN_TABLEis disabled by this patch.
Why not removing the code?
It's still and will be in the Git index, it won't disappear.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Sakari Ailus
reviewerHi Andy,
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Sakari Ailus
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 withS_PARAMETERSand bail out otherwise, in order to ease backporting.In particular,
ATOMISP_IOC_S_ISP_FPN_TABLEis 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.
Signature · 3 lines
Regards, Sakari Ailus
Andy Shevchenko
Reviewed-byQuoted 9 lines · Sakari Ailus
Quoted 8 lines · Andy Shevchenko
Quoted 6 lines · Sakari Ailus
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 withS_PARAMETERSand bail out otherwise, in order to ease backporting.In particular,
ATOMISP_IOC_S_ISP_FPN_TABLEis disabled by this patch.
Quoted 8 lines
Quoted 2 lines
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,
Signature · 2 lines
With Best Regards, Andy Shevchenko