From: Takashi Iwai <tiwai@suse.de>
To: "Bo Chen" <chenbo@pdx.edu>
Cc: <alsa-devel@alsa-project.org>, <perex@perex.cz>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream()
Date: Fri, 01 Jun 2018 09:39:29 +0200 [thread overview]
Message-ID: <s5hzi0f3qha.wl-tiwai@suse.de> (raw)
In-Reply-To: <20180531223518.18675-1-chenbo@pdx.edu>
On Fri, 01 Jun 2018 00:35:18 +0200,
Bo Chen wrote:
>
> When 'kzalloc()' fails in 'snd_hda_attach_pcm_stream()', a new pcm instance is
> created without setting its operators via 'snd_pcm_set_ops()'. Following
> operations on the new pcm instance can trigger kernel null pointer dereferences
> and cause kernel oops.
>
> This bug was found with my work on building a gray-box fault-injection tool for
> linux-kernel-module binaries. A kernel null pointer dereference was confirmed
> from line 'substream->ops->open()' in function 'snd_pcm_open_substream()' in
> file 'sound/core/pcm_native.c'.
>
> This patch fixes the bug by calling 'snd_device_free()' in the error handling
> path of 'kzalloc()', which removes the new pcm instance from the snd card before
> returns with an error code.
>
> Signed-off-by: Bo Chen <chenbo@pdx.edu>
Applied now. Thanks.
Takashi
prev parent reply other threads:[~2018-06-01 7:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-31 22:35 Bo Chen
2018-06-01 7:39 ` 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=s5hzi0f3qha.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=chenbo@pdx.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
/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
all inboxes | Powered by JetHome®