linux-stable/drivers/media/v4l2-core
Mauro Carvalho Chehab 4c76f331a9 media: v4l2-ctrls-api: fix error handling for v4l2_g_ctrl()
As detected by Coverity, the error check logic at get_ctrl() is
broken: if ptr_to_user() fails to fill a control due to an error,
no errors are returned and v4l2_g_ctrl() returns success on a
failed operation, which may cause applications to fail.

Add an error check at get_ctrl() and ensure that it will
be returned to userspace without filling the control value if
get_ctrl() fails.

Fixes: 71c689dc2e ("media: v4l2-ctrls: split up into four source files")
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2024-10-18 10:43:03 +02:00
..
Kconfig media: remove the old videobuf framework 2023-09-27 09:40:01 +02:00
Makefile media: remove the old videobuf framework 2023-09-27 09:40:01 +02:00
tuner-core.c media: Switch i2c drivers back to use .probe() 2023-05-25 16:21:21 +02:00
v4l2-async.c media: v4l: add missing MODULE_DESCRIPTION() macros 2024-06-15 11:16:40 +02:00
v4l2-cci.c media: v4l2-cci: Always assign *val 2024-06-04 08:31:25 +02:00
v4l2-common.c media: uapi: Add a pixel format for BGR48 and RGB48 2024-06-27 13:06:47 +02:00
v4l2-compat-ioctl32.c media: core: Report the maximum possible number of buffers for the queue 2023-11-23 12:38:05 +01:00
v4l2-ctrls-api.c media: v4l2-ctrls-api: fix error handling for v4l2_g_ctrl() 2024-10-18 10:43:03 +02:00
v4l2-ctrls-core.c Revert "media: v4l2-ctrls: show all owned controls in log_status" 2024-05-10 11:20:02 +02:00
v4l2-ctrls-defs.c media: v4l2-ctrls: Add average QP control 2024-06-10 10:24:30 +02:00
v4l2-ctrls-priv.h media: v4l2-ctrls: add support for dynamically allocated arrays. 2022-07-15 16:20:53 +01:00
v4l2-ctrls-request.c media: v4l2-ctrls: add support for dynamically allocated arrays. 2022-07-15 16:20:53 +01:00
v4l2-dev.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
v4l2-device.c media: v4l: Set sub-device's owner field to the caller's module 2024-04-26 11:30:43 +01:00
v4l2-dv-timings.c media: v4l2-dv-timings.c: fix too strict blanking sanity checks 2022-11-23 12:02:30 +00:00
v4l2-event.c media: v4l2-event: Annotate struct v4l2_subscribed_event with __counted_by 2023-10-07 10:55:45 +02:00
v4l2-fh.c media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release 2021-06-02 13:17:44 +02:00
v4l2-flash-led-class.c media: v4l2-flash: Fix comment typo 2022-08-29 15:32:14 +02:00
v4l2-fwnode.c media: v4l: add missing MODULE_DESCRIPTION() macros 2024-06-15 11:16:40 +02:00
v4l2-h264.c media: drivers/media/v4l2-core/v4l2-h264 : add detection of null pointers 2023-02-08 07:33:41 +01:00
v4l2-i2c.c media: v4l: Set sub-device's owner field to the caller's module 2024-04-26 11:30:43 +01:00
v4l2-ioctl.c media: uapi: videodev2: Add V4L2_META_FMT_RK_ISP1_EXT_PARAMS 2024-08-12 13:36:32 +03:00
v4l2-jpeg.c media: v4l2-jpeg: Export reference quantization and huffman tables 2024-06-24 11:05:06 +02:00
v4l2-mc.c media: v4l2-mc: Add debug prints for v4l2_fwnode_create_links_for_pad() 2024-01-22 17:23:59 +01:00
v4l2-mem2mem.c media: v4l2: Add mem2mem helpers for REMOVE_BUFS ioctl 2024-03-25 12:00:44 +01:00
v4l2-spi.c media: v4l: Set sub-device's owner field to the caller's module 2024-04-26 11:30:43 +01:00
v4l2-subdev-priv.h media: v4l2-core: Make the v4l2-core code enable/disable the privacy LED if present 2023-02-03 10:22:34 +01:00
v4l2-subdev.c media: v4l2-subdev: Support hybrid links in v4l2_subdev_link_validate() 2024-08-26 16:36:14 +03:00
v4l2-trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
v4l2-vp9.c media: Add VP9 v4l2 library 2021-11-22 07:47:13 +00:00