]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-core: explicitly clear ioctl input data
authorArnd Bergmann <arnd@arndb.de>
Mon, 14 Jun 2021 10:34:03 +0000 (12:34 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 17 Jun 2021 08:15:32 +0000 (10:15 +0200)
commit39b3c7266b98ee57dc34c8482ead0d5ae06491fc
treeaeff6b1de833af0fae3d919b0cca06470362431e
parent598cc2bbf81576d176cb0eabe59a609824ee2603
media: v4l2-core: explicitly clear ioctl input data

As seen from a recent syzbot bug report, mistakes in the compat ioctl
implementation can lead to uninitialized kernel stack data getting used
as input for driver ioctl handlers.

The reported bug is now fixed, but it's possible that other related
bugs are still present or get added in the future. As the drivers need
to check user input already, the possible impact is fairly low, but it
might still cause an information leak.

To be on the safe side, always clear the entire ioctl buffer before
calling the conversion handler functions that are meant to initialize
them.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/v4l2-core/v4l2-ioctl.c