From: Maoyi Xie <maoyixie.tju@gmail.com>
To: Clemens Ladisch <clemens@ladisch.de>,
Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH v2 0/3] ALSA: bebob/oxfw: bound AV/C response walks to the response length
Date: Mon, 30 Nov 2026 18:49:46 +0800 [thread overview]
Message-ID: <20261130104949.2216908-1-maoyixie.tju@gmail.com> (raw)
The BeBoB and OXFW drivers walk three AV/C responses by counts that the
device puts into the response. None of the walks is checked against the
length of the response. A count that is too large reads past the
response buffer, or later past a stored copy of the format.
Each patch rejects such a response with -EIO. A complete response is
handled as before. The formats in the Griffin FireWave dump at [1] pass
the new check. I found no such dump of a BeBoB device.
Found with a CodeQL-based static analysis tool that we are developing.
Each case was reproduced in a userspace harness under AddressSanitizer.
Not tested on hardware. Compile-tested with W=1 on next-20261116.
I used an LLM to help write the harnesses and these patches.
Changes in v2:
- Patch 3 checks the length in snd_oxfw_stream_parse_format() instead of
a new function, as Takashi Sakamoto suggested. The stored formats keep
their length for the later calls.
- Patches 1 and 2 are unchanged.
v1: https://lore.kernel.org/all/20261125121238.1602172-1-maoyixie.tju@gmail.com/
[1] https://lore.kernel.org/all/543FD6AA.5080004@sakamocchi.jp/
Maoyi Xie (3):
ALSA: bebob: bound the channel position walk to the response length
ALSA: bebob: bound the stream format entries to the response length
ALSA: oxfw: bound the stream format entries to the response length
sound/firewire/bebob/bebob.h | 2 +-
sound/firewire/bebob/bebob_command.c | 5 +--
sound/firewire/bebob/bebob_stream.c | 15 +++++++--
sound/firewire/oxfw/oxfw-pcm.c | 44 +++++++++++++++++++------
sound/firewire/oxfw/oxfw-proc.c | 6 ++--
sound/firewire/oxfw/oxfw-stream.c | 48 +++++++++++++++++++++-------
sound/firewire/oxfw/oxfw.h | 3 ++
7 files changed, 95 insertions(+), 28 deletions(-)
--
2.34.1
next reply other threads:[~2026-11-30 10:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 10:49 Maoyi Xie [this message]
2026-11-30 10:49 ` [PATCH v2 1/3] ALSA: bebob: bound the channel position walk to the response length Maoyi Xie
2026-11-30 10:49 ` [PATCH v2 2/3] ALSA: bebob: bound the stream format entries " Maoyi Xie
2026-11-30 10:59 ` sashiko-bot
2026-11-30 10:49 ` [PATCH v2 3/3] ALSA: oxfw: " Maoyi Xie
2026-12-01 13:43 ` Takashi Sakamoto
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=20261130104949.2216908-1-maoyixie.tju@gmail.com \
--to=maoyixie.tju@gmail.com \
--cc=clemens@ladisch.de \
--cc=linux-sound@vger.kernel.org \
--cc=o-takashi@sakamocchi.jp \
--cc=perex@perex.cz \
--cc=stable@vger.kernel.org \
--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 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.