From: "Zhou, Yun" <yun.zhou@windriver.com>
To: mchehab@kernel.org, kees@kernel.org, linma@zju.edu.cn
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] media: dvb-core: fix use-after-free in dvb_frontend_open()
Date: Thu, 2 Jul 2026 18:01:25 +0800 [thread overview]
Message-ID: <de72c571-b06c-45cd-a475-bcf077b6c91c@windriver.com> (raw)
In-Reply-To: <53782a92-ca2a-4e48-b9d8-b420741e952a@windriver.com>
Friendly ping again
On 6/25/26 19:24, Zhou, Yun wrote:
> Friendly ping
>
> On 6/10/26 16:30, Yun Zhou wrote:
>> dvb_frontend_open() calls dvb_generic_release() in its error path after
>> dvb_generic_open() succeeds. dvb_generic_release() drops the device
>> reference via dvb_device_put(), and then dvb_device_open() drops it again
>> in its error handling, causing a use-after-free and refcount underflow.
>>
>> Fix this by incrementing the refcount before dvb_generic_release() in the
>> error path, so that the put inside dvb_generic_release() is balanced and
>> dvb_device_open() remains the sole effective put on open failure.
>>
>> Reported-by: syzbot+40339ea82afa8184ad5d@syzkaller.appspotmail.com
>> Closes: https://syzkaller.appspot.com/bug?extid=40339ea82afa8184ad5d
>> Cc: stable@vger.kernel.org
>> Fixes: 0fc044b2b5e2 ("media: dvbdev: adopts refcnt to avoid UAF")
>> Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
>> ---
>> v3:
>> - Simplify fix: increment refcount before dvb_generic_release() instead
>> of introducing __dvb_generic_release()
>>
>> v2:
>> - Fix Fixes tag commit title
>> - Add Closes: link after Reported-by
>> - Cc stable@vger.kernel.org
>>
>> drivers/media/dvb-core/dvb_frontend.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/
>> dvb-core/dvb_frontend.c
>> index d082b6c57c76..608525d08277 100644
>> --- a/drivers/media/dvb-core/dvb_frontend.c
>> +++ b/drivers/media/dvb-core/dvb_frontend.c
>> @@ -2887,6 +2887,7 @@ static int dvb_frontend_open(struct inode
>> *inode, struct file *file)
>> mutex_unlock(&fe->dvb->mdev_lock);
>> err2:
>> #endif
>> + dvb_device_get(dvbdev);
>> dvb_generic_release(inode, file);
>> err1:
>> if (dvbdev->users == -1 && fe->ops.ts_bus_ctrl)
>
next prev parent reply other threads:[~2026-07-02 10:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 8:30 [PATCH v3] media: dvb-core: fix use-after-free in dvb_frontend_open() Yun Zhou
2026-06-17 0:29 ` Zhou, Yun
2026-06-25 11:24 ` Zhou, Yun
2026-07-02 10:01 ` Zhou, Yun [this message]
2026-07-07 6:55 ` Zhou, Yun
-- strict thread matches above, loose matches on Subject: below --
2026-05-22 3:02 Yun Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=de72c571-b06c-45cd-a475-bcf077b6c91c@windriver.com \
--to=yun.zhou@windriver.com \
--cc=kees@kernel.org \
--cc=linma@zju.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox