Linux Media Controller development
 help / color / mirror / Atom feed
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: Wed, 17 Jun 2026 08:29:28 +0800	[thread overview]
Message-ID: <83e232f7-9336-454e-9780-08ea1aa44f8d@windriver.com> (raw)
In-Reply-To: <20260610083055.3976083-1-yun.zhou@windriver.com>

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)


  reply	other threads:[~2026-06-17  0:29 UTC|newest]

Thread overview: 5+ 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 [this message]
2026-06-25 11:24 ` Zhou, Yun
2026-07-02 10:01   ` 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=83e232f7-9336-454e-9780-08ea1aa44f8d@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