linux/drivers/media
Kees Cook 0b962b0345 media: uvcvideo: Silence memcpy() run-time false positive warnings
[ Upstream commit b839212988 ]

The memcpy() in uvc_video_decode_meta() intentionally copies across the
length and flags members and into the trailing buf flexible array.
Split the copy so that the compiler can better reason about (the lack
of) buffer overflows here. Avoid the run-time false positive warning:

  memcpy: detected field-spanning write (size 12) of single field "&meta->length" at drivers/media/usb/uvc/uvc_video.c:1355 (size 1)

Additionally fix a typo in the documentation for struct uvc_meta_buf.

Reported-by: ionut_n2001@yahoo.com
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216810
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-03-11 13:50:39 +01:00
..
cec media: Switch to use dev_err_probe() helper 2022-12-07 17:58:46 +01:00
common media: videobuf2: set q->streaming later 2023-01-24 16:34:06 +01:00
dvb-core Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
dvb-frontends media updates for v6.2-rc1 2022-12-13 11:36:58 -08:00
firewire media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00
i2c media: i2c: ov7670: 0 instead of -EINVAL was returned 2023-03-10 09:29:04 +01:00
mc media: mc: Get media_device directly from pad 2023-03-10 09:29:01 +01:00
mmc media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
pci media: ipu3-cio2: Fix PM runtime usage_count in driver unbind 2023-03-10 09:29:49 +01:00
platform media: amphion: correct the unspecified color space 2023-03-10 09:29:03 +01:00
radio media: si470x: Fix use-after-free in si470x_int_in_callback() 2022-12-07 17:58:47 +01:00
rc media: rc: Fix use-after-free bugs caused by ene_tx_irqsim() 2023-03-10 09:29:03 +01:00
spi media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
test-drivers media updates for v6.2-rc1 2022-12-13 11:36:58 -08:00
tuners Tag branch 2022-11-25 07:55:21 +00:00
usb media: uvcvideo: Silence memcpy() run-time false positive warnings 2023-03-11 13:50:39 +01:00
v4l2-core media: drivers/media/v4l2-core/v4l2-h264 : add detection of null pointers 2023-03-10 09:29:03 +01:00
Kconfig media: Kconfig: Make DVB_CORE=m possible when MEDIA_SUPPORT=y 2022-12-07 17:58:46 +01:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00