linux-stable/drivers/media/usb/pwc
Gustavo A. R. Silva 389b6a2261 media: usb: pwc-uncompress: Use flex array destination for memcpy()
In preparation for FORTIFY_SOURCE performing run-time destination buffer
bounds checking for memcpy(), specify the destination output buffer
explicitly, instead of asking memcpy() to write past the end of what looked
like a fixed-size object.

Notice that raw_frame is a pointer to a structure that contains
flexible-array member rawframe[]:

drivers/media/usb/pwc/pwc.h:
190 struct pwc_raw_frame {
191         __le16 type;            /* type of the webcam */
192         __le16 vbandlength;     /* Size of 4 lines compressed (used by the
193                                    decompressor) */
194         __u8   cmd[4];          /* the four byte of the command (in case of
195                                    nala, only the first 3 bytes is filled) */
196         __u8   rawframe[];      /* frame_size = H / 4 * vbandlength */
197 } __packed;

Link: https://github.com/KSPP/linux/issues/200
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-12-07 17:58:46 +01:00
..
Kconfig media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
pwc-ctrl.c media: pwc-ctl: remove redundant assignment to variable ret 2020-04-21 13:25:18 +02:00
pwc-dec1.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pwc-dec1.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pwc-dec23.c media: fix incorrect kernel doc usages 2021-03-11 11:59:44 +01:00
pwc-dec23.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pwc-if.c media: media/usb:Remove superfluous "breaks" 2021-03-11 11:59:43 +01:00
pwc-kiara.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pwc-kiara.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pwc-misc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pwc-nala.h
pwc-timon.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pwc-timon.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pwc-uncompress.c media: usb: pwc-uncompress: Use flex array destination for memcpy() 2022-12-07 17:58:46 +01:00
pwc-v4l.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
pwc.h media: pwc: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00