From: Mark Brown <broonie@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
Takashi Iwai <tiwai@suse.com>,
linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH] ASoC: soc-core: Add missing NULL check
Date: Fri, 9 Mar 2018 12:50:50 +0000 [thread overview]
Message-ID: <20180309125050.GD5252@sirena.org.uk> (raw)
In-Reply-To: <20180308200653.GA47801@beast>
[-- Attachment #1.1: Type: text/plain, Size: 734 bytes --]
On Thu, Mar 08, 2018 at 12:06:53PM -0800, Kees Cook wrote:
> If a codec is not attached to the sound soc, a NULL deref is possible as a
> regular user in /sys.
I can't parse this, sorry. What is the "sound soc"?
> +++ b/sound/soc/soc-core.c
> @@ -137,6 +137,9 @@ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf,
> size_t total = 0;
> loff_t p = 0;
>
> + if (!codec || !codec->driver)
> + return 0;
> +
How are we managing to create a sysfs file for a CODEC which doesn't
have a CODEC struct associated with it? That is obviously nonsensical
and suggests we've got some more serious problem going on here - if
there's no CODEC those sysfs attributes simply shouldn't be there.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2018-03-09 12:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-08 20:06 [PATCH] ASoC: soc-core: Add missing NULL check Kees Cook
2018-03-09 12:50 ` Mark Brown [this message]
2018-03-09 18:45 ` Kees Cook
2018-03-09 19:35 ` Pavel Machek
2018-03-09 20:22 ` Mark Brown
2018-03-12 10:31 ` Charles Keepax
2018-03-12 16:02 ` Mark Brown
2018-03-09 20:19 ` Pavel Machek
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=20180309125050.GD5252@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=keescook@chromium.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.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).