linux/drivers/media/common/videobuf2
Hans Verkuil 1df7b8cd3a media: videobuf2: improve max_num_buffers sanity checks
Ensure that drivers set max_num_buffers to a value >= 32.
For now there is no reason for drivers to request a lower
limit and doing so might potentially cause userspace issues.
Note that the old check of > MAX_BUFFER_INDEX was pointless
since q->max_num_buffers was already limited to MAX_BUFFER_INDEX
or less.

Also add a sanity check in __vb2_init_fileio(), returning
-ENOSPC if a driver returns more than 32 buffers from
VIDIOC_REQBUFS with count = q->min_reqbufs_allocation.

The vb2_fileio_data struct only supports up to 32 buffers,
so we need a check there.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-24 13:49:55 +02:00
..
frame_vector.c media: use struct_size() helper 2023-09-27 09:40:01 +02:00
Kconfig
Makefile media: Makefiles: sort entries where it fits 2022-03-14 09:42:59 +01:00
vb2-trace.c
videobuf2-core.c media: videobuf2: improve max_num_buffers sanity checks 2024-04-24 13:49:55 +02:00
videobuf2-dma-contig.c media: videobuf2: Fix IS_ERR checking in vb2_dc_put_userptr() 2023-10-13 11:33:22 +02:00
videobuf2-dma-sg.c media: videobuf2-dma-sg: fix vmap callback 2023-12-07 08:31:14 +01:00
videobuf2-dvb.c media: vb2: videobuf -> videobuf2 2022-08-29 15:38:09 +02:00
videobuf2-memops.c media: videobuf2: revert "get_userptr: buffers are always writable" 2022-12-06 07:14:31 +00:00
videobuf2-v4l2.c media: v4l2: Add REMOVE_BUFS ioctl 2024-03-25 12:00:44 +01:00
videobuf2-vmalloc.c media: videobuf2: Fix IS_ERR checking in vb2_vmalloc_put_userptr() 2023-10-13 11:33:22 +02:00