]> git.baikalelectronics.ru Git - kernel.git/commit
media: vivid: s_fbuf: add more sanity checks
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 12 Oct 2022 14:32:28 +0000 (15:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:56:55 +0000 (23:56 +0900)
commit7f781c61284f3f4ba8f781c4272f5a22e5bf3d73
treeaacde72da4b207a67a141b0934c0ba4325767b55
parent4340b3d8d06f3124afd2554f585494b0e7c6c718
media: vivid: s_fbuf: add more sanity checks

[ Upstream commit 62bcf16b30414622dff962e3fb026a8c0716c1b8 ]

VIDIOC_S_FBUF is by definition a scary ioctl, which is why only root
can use it. But at least check if the framebuffer parameters match that
of one of the framebuffer created by vivid, and reject anything else.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: 9f111085007a ([media] vivid: add the video capture and output parts)
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/vivid/vivid-core.c
drivers/media/platform/vivid/vivid-core.h
drivers/media/platform/vivid/vivid-vid-cap.c