mbox series

[0/2] media: videobuf2: make sure bytesused is smaller than the buffer size

Message ID 20211108193933.20369-1-dafna.hirschfeld@collabora.com (mailing list archive)
Headers show
Series media: videobuf2: make sure bytesused is smaller than the buffer size | expand

Message

Dafna Hirschfeld Nov. 8, 2021, 7:39 p.m. UTC
Add a WARN_ON in vb2_set_plane_payload if bytesused is bigger than length.
Also change places where bytesused is set directly with that function.
This help find/eliminate possible buffer overflow.

Dafna Hirschfeld (2):
  media: replace setting of bytesused with vb2_set_plane_payload
  media: videobuf2: add WARN_ON if bytesused is bigger than buffer
    length

 drivers/media/platform/allegro-dvt/allegro-core.c  |  2 +-
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 10 +++++-----
 drivers/media/test-drivers/vicodec/vicodec-core.c  |  2 +-
 drivers/media/usb/go7007/go7007-driver.c           |  2 +-
 drivers/staging/media/meson/vdec/vdec_helpers.c    | 10 +++++-----
 include/media/videobuf2-core.h                     |  4 +++-
 6 files changed, 16 insertions(+), 14 deletions(-)