All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
	Steve Lee <steves.lee@maximintegrated.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [GIT PULL] ASoC updates for v5.8
Date: Tue, 2 Jun 2020 20:03:34 +0100	[thread overview]
Message-ID: <20200602190334.GK5684@sirena.org.uk> (raw)
In-Reply-To: <s5hv9k9fmha.wl-tiwai@suse.de>

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

On Tue, Jun 02, 2020 at 06:42:25PM +0200, Takashi Iwai wrote:

> But, looking more at the code around that line, I could spot many
> other bugs.  You cannot trust the firmware file and you must check the
> size.  The current code can trigger out-of-bound accesses and crash
> very easily when a malformed firmware file is tossed; e.g. just put an
> empty file (or a huge file) as dsm_param.bin.

Yeah, it's not great - the potential impact is limited by regmap which
will bounds check attempts to write beyond the last register (though now
I look again we're using unsigned values so we should definitely be
limiting the lower size) but it would be better to limit it to just the
registers that should be being configured.  Possibly even just to one
valid file length if it's always all the same registers being configured.

Steve?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-06-02 19:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 12:13 [GIT PULL] ASoC updates for v5.8 Mark Brown
2020-06-01 18:44 ` Takashi Iwai
2020-06-01 21:17   ` Takashi Iwai
2020-06-02 16:42     ` Takashi Iwai
2020-06-02 19:03       ` Mark Brown [this message]
2020-06-03  6:54         ` Steve Lee
2020-06-03  6:51       ` Steve Lee

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=20200602190334.GK5684@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=lgirdwood@gmail.com \
    --cc=steves.lee@maximintegrated.com \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.