media: v4l2-subdev: Fix a 64bit bug
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 3 Nov 2023 07:39:24 +0000 (10:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:52:21 +0000 (08:52 +0100)
commit2cc612b8ed89f3e80869a736b6551dd296875bdc
treefd465fbce49b4bd4305ade5fba7ad0dfa8d21946
parenta9659016f9ebc0868b74d1982e38d3af4511f948
media: v4l2-subdev: Fix a 64bit bug

[ Upstream commit 5d33213fac5929a2e7766c88d78779fd443b0fe8 ]

The problem is this line here from subdev_do_ioctl().

        client_cap->capabilities &= ~V4L2_SUBDEV_CLIENT_CAP_STREAMS;

The "client_cap->capabilities" variable is a u64.  The AND operation
is supposed to clear out the V4L2_SUBDEV_CLIENT_CAP_STREAMS flag.  But
because it's a 32 bit variable it accidentally clears out the high 32
bits as well.

Currently we only use the first bit and none of the upper bits so this
doesn't affect runtime behavior.

Fixes: f57fa2959244 ("media: v4l2-subdev: Add new ioctl for client capabilities")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/uapi/linux/v4l2-subdev.h