media: v4l2-core: fix a use-after-free bug of sd->devnode
sd->devnode is released after calling
v4l2_subdev_release. Therefore it should be set
to NULL so that the subdev won't hold a pointer
to a released object. This fixes a reference
after free bug in function
v4l2_device_unregister_subdev
Fixes: 0e43734d4c
("media: v4l2-subdev: add release() internal op")
Cc: stable@vger.kernel.org
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Родитель
403265137f
Коммит
6990570f7e
|
@ -179,6 +179,7 @@ static void v4l2_subdev_release(struct v4l2_subdev *sd)
|
|||
|
||||
if (sd->internal_ops && sd->internal_ops->release)
|
||||
sd->internal_ops->release(sd);
|
||||
sd->devnode = NULL;
|
||||
module_put(owner);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче