Commit cc268ce2 authored by Peilin Ye's avatar Peilin Ye Committed by Wenyu Huang
Browse files

media: dvbdev: Fix memory leak in dvb_media_device_free()

stable inclusion
from stable-v4.19.308
commit cd89f79be5d553c78202f686e8e4caa5fbe94e98
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I949D9
CVE: CVE-2020-36777

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cd89f79be5d553c78202f686e8e4caa5fbe94e98

--------------------------------

commit bf9a40ae upstream.

dvb_media_device_free() is leaking memory. Free `dvbdev->adapter->conn`
before setting it to NULL, as documented in include/media/media-device.h:
"The media_entity instance itself must be freed explicitly by the driver
if required."

Link: https://syzkaller.appspot.com/bug?id=9bbe4b842c98f0ed05c5eed77a226e9de33bf298

Link: https://lore.kernel.org/linux-media/20201211083039.521617-1-yepeilin.cs@gmail.com


Cc: stable@vger.kernel.org
Fixes: 0230d60e ("[media] dvbdev: Add RF connector if needed")
Reported-by: default avatar <syzbot+7f09440acc069a0d38ac@syzkaller.appspotmail.com>
Signed-off-by: default avatarPeilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWenyu Huang <huangwenyu5@huawei.com>
parent 415aa2f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment