Skip to content

Commit eec7de8

Browse files
Yunlongsgregkh
authored andcommitted
media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release
[ Upstream commit 7dd0c9e547b6924e18712b6b51aa3cba1896ee2c ] A use after free bug caused by the dangling pointer filp->privitate_data in v4l2_fh_release. See https://lore.kernel.org/patchwork/patch/1419058/. My patch sets the dangling pointer to NULL to provide robust. Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 335ffa6 commit eec7de8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/media/v4l2-core/v4l2-fh.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ int v4l2_fh_release(struct file *filp)
107107
v4l2_fh_del(fh);
108108
v4l2_fh_exit(fh);
109109
kfree(fh);
110+
filp->private_data = NULL;
110111
}
111112
return 0;
112113
}

0 commit comments

Comments
 (0)