summaryrefslogtreecommitdiff
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2022-09-07 21:55:44 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2022-12-07 19:58:46 +0300
commit389b6a226188c13ec3d5d8b3522aabd68aab2694 (patch)
tree36ae1344f1c1824bc704dfcd6464a474d1372747 /drivers/media/radio
parentd8a46bc4e1e0446459daa77c4ce14218d32dacf9 (diff)
downloadlinux-389b6a226188c13ec3d5d8b3522aabd68aab2694.tar.xz
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>
Diffstat (limited to 'drivers/media/radio')
0 files changed, 0 insertions, 0 deletions