From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Mark Brown <broonie@kernel.org>,
"Jaroslav Kysela" <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Subject: Re: [PATCH] ASoC: Intel: avs: validate configuration TLV bounds
Date: Wed, 15 Jul 2026 10:59:21 +0200 [thread overview]
Message-ID: <03980ec0-b96a-4df6-8458-d11bf3f2e384@intel.com> (raw)
In-Reply-To: <20260715083340.24372-1-pengpeng@iscas.ac.cn>
On 7/15/2026 10:33 AM, Pengpeng Hou wrote:
> Firmware and hardware configuration replies are parsed as a sequence of
> TLVs. The walkers only check that the complete reply is non-empty before
> casting the current offset to struct avs_tlv, reading its header, and
> consuming type-specific values. A short header or a declared value that
> extends past the reply can therefore be consumed as part of the current
> item.
>
> Validate the fixed TLV header and the declared value span before dispatch.
> Also require the value space used by the selected type: firmware version
> copies need the complete version structure, scalar configuration values
> need one u32, and I2S capabilities need their two-word prefix plus all
> declared controller addresses.
Hello Pengpeng,
I understand where are you coming from but there is no reason for such
defense - as per Intel audio driver architecture, firmware is the root
of trust. If one breaches the verification mechanism, the TLVs are the
least of our problems.
At the same time, struct avs_tlv is no different from any TLV in the
kernel so I'd rather see the functions you're adding here applied to the
kernel/ or drivers/base or other common location, not hidden within
sound/soc/intel/avs/.
TLDR: NAK
Kind regards,
Czarek
next prev parent reply other threads:[~2026-07-15 8:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 8:33 Pengpeng Hou
2026-07-15 8:59 ` Cezary Rojewski [this message]
2026-07-15 13:33 ` Pengpeng Hou
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=03980ec0-b96a-4df6-8458-d11bf3f2e384@intel.com \
--to=cezary.rojewski@intel.com \
--cc=broonie@kernel.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=pengpeng@iscas.ac.cn \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.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
Powered by JetHome