Skip to content

Commit f9f334f

Browse files
Yunlongsgregkh
authored andcommitted
media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release
[ Upstream commit 7dd0c9e ] 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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 5d00265 commit f9f334f

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
@@ -96,6 +96,7 @@ int v4l2_fh_release(struct file *filp)
9696
v4l2_fh_del(fh);
9797
v4l2_fh_exit(fh);
9898
kfree(fh);
99+
filp->private_data = NULL;
99100
}
100101
return 0;
101102
}

0 commit comments

Comments
 (0)