From: Takashi Iwai <tiwai@suse.de>
To: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Cc: perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sound/isa/ib: Fix two use after free in snd_sb_qsound_build
Date: Mon, 26 Apr 2021 18:01:26 +0200 [thread overview]
Message-ID: <s5hzgxl11d5.wl-tiwai@suse.de> (raw)
In-Reply-To: <20210426145541.8070-1-lyl2019@mail.ustc.edu.cn>
On Mon, 26 Apr 2021 16:55:41 +0200,
Lv Yunlong wrote:
>
> In snd_sb_qsound_build, snd_ctl_add(..,p->qsound_switch...) and
> snd_ctl_add(..,p->qsound_space..) are called. But the second
> arguments of snd_ctl_add() could be freed via snd_ctl_add_replace()
> ->snd_ctl_free_one(). After the error code is returned,
> snd_sb_qsound_destroy(p) is called in __error branch.
>
> But in snd_sb_qsound_destroy(), the freed p->qsound_switch and
> p->qsound_space are still used by snd_ctl_remove().
>
> My patch set p->qsound_switch and p->qsound_space to NULL if
> snd_ctl_add() failed to avoid the uaf bugs. But these codes need
> to further be improved with the code style.
>
> Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Thanks, applied now.
Takashi
prev parent reply other threads:[~2021-04-26 16:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-26 14:55 [PATCH] sound/isa/ib: Fix two use after free in snd_sb_qsound_build Lv Yunlong
2021-04-26 16:01 ` Takashi Iwai [this message]
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=s5hzgxl11d5.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lyl2019@mail.ustc.edu.cn \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/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;
as well as URLs for NNTP newsgroup(s).