]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: videobuf2: forbid remove_bufs when legacy fileio is active
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 23 Oct 2025 14:26:34 +0000 (16:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:40 +0000 (15:37 -0500)
commite819b34df0a7030a15c968d619fa8a3ed2455c7a
treee132d15003897346b08157032c8f9bf09e56c4e4
parent7b1289ca5ca9724b73db9cf48a23ce24b3f76f26
media: videobuf2: forbid remove_bufs when legacy fileio is active

commit 27afd6e066cfd80ddbe22a4a11b99174ac89cced upstream.

vb2_ioctl_remove_bufs() call manipulates queue internal buffer list,
potentially overwriting some pointers used by the legacy fileio access
mode. Forbid that ioctl when fileio is active to protect internal queue
state between subsequent read/write calls.

CC: stable@vger.kernel.org
Fixes: a3293a85381e ("media: v4l2: Add REMOVE_BUFS ioctl")
Reported-by: Shuangpeng Bai <SJB7183@psu.edu>
Closes: https://lore.kernel.org/linux-media/5317B590-AAB4-4F17-8EA1-621965886D49@psu.edu/
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/common/videobuf2/videobuf2-v4l2.c