8000 alsa-lib: backport CVE-2026-90781 fix, declare GithubRepo provenance by bryan-minimal · Pull Request #915 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

alsa-lib: backport CVE-2026-90781 fix, declare GithubRepo provenance - #915

Merged
bryan-minimal merged 3 commits into
mainfrom
alsa-lib-cve-backport
Oct 23, 2026
Merged

bryan-minimal merged 3 commits into
mainfrom
alsa-lib-cve-backport

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Oct 17, 2026 •
Copy link
Copy Markdown
Member

What this fixes

CVE-2026-90781 is a one-byte stack overrun in __snd_ctl_ascii_elem_id_parse() (src/control/ctlparse.c). The function copies a name= value into a 64-byte buf, and a name of 64 or more characters makes it write the closing '\0' one byte past the end. The NVD/CVE text says "alsa-lib through 1.2.16.1". 1.2.16.1 is what we ship, and it is still the latest release.

  • Upstream fix: alsa-project/alsa-lib@f84cd4c (2026-08-30), not yet in any release. gh api …/compare/f84cd4c...v1.2.16.1 returns behind, so the fix is not in our tag.
  • Second site, also unreleased: f84cd4c's message says it "follows" 1e27d63e (2026-06-02), which fixes the same one-byte overrun on the numid= branch of the same function. git merge-base --is-ancestor 1e27d63e v1.2.16.1 is false, so f84cd4c alone would leave that site open. These two are the only commits touching ctlparse.c since the tag, and with both applied all three copy loops bound at sizeof(buf) - 1.
  • Debian: carries f84cd4c as 1.2.16.1-2.
  • Where we found it: the Ruby on Rails development support: chromedriver, Ruby 3.x, initdb locale fix, dev-loop tools #848 Debian-revision audit, hand-verified against security-tracker.debian.org (gominimal/pkgmgr-rs#848).

Changes

  1. CVE-2026-90781.patch (f84cd4c) and CVE-2026-90781-numid.patch (1e27d63e). Each is the upstream commit's git format-patch, unmodified. They touch different hunks and apply in either order. build.sh applies it with patch -Np1 under set -e, so a hunk that no longer applies fails the build instead of shipping an unpatched library. This follows the existing wget and python pattern, and adds patch to build_deps.
  2. Regression test, run at build time and never installed. The bug writes only a '\0' one byte out of bounds, so nothing observable changes and a plain behavioural test can't see it. The test therefore compiles ctlparse.c itself under -fsanitize=address, because the copy inside libasound.so is not instrumented. It then parses 100-character quoted and unquoted name= values and a 100-digit numid=.
    • Patched: both name parses succeed with the name truncated in bounds; the numid parse is rejected as out of range (-22) after an in-bounds copy.
    • Negative control, f84cd4c disabled (fresh session): the build fails with AddressSanitizer: stack-buffer-overflow … ctlparse.c:239 in __snd_ctl_ascii_elem_id_parse.
    • Negative control, 1e27d63e disabled (fresh session): the build fails with AddressSanitizer: stack-buffer-overflow … ctlparse.c:182 in __snd_ctl_ascii_elem_id_parse, the numid= branch.
  3. source_provenance = GithubRepo alsa-project/alsa-lib. alsa-lib had no provenance, so the advisory pipeline never asked about it, and it has zero advisory_lifecycle rows. This advisory already sits in prod advisories under pkg:github/alsa-project/alsa-lib, the purl this provenance produces. github.com/alsa-project is upstream's own home, not a mirror. The alsa-project.org tarball URL in the comment is the release download.

Verification

All of this ran in a min session with the pkgbuild loadout, on arm64:

  • min package build --rebuild --verbose alsa-lib: patching file src/control/ctlparse.c (twice), make check passes, the regression test passes, build finished.
  • Negative controls as described above: the build fails on ASan for each patch dropped alone. Each run used a freshly activated session.
  • min check --packages alsa-lib: every check passes, including the build-dependent enumerate-bins, missing-runtime_deps and standalone tests.

Notes for the reviewer

  • This finding will show up once the PR merges, and that is correct for the tag but stale for our build. With provenance in place, the scanner will report CVE-2026-90781 as affected at 1.2.16.1. The record says "through 1.2.16.1", and sc#500 keeps such records affected even though OSV's converted range resolves fixed: 1.2.16.1 to the release commit. The scanner does not see carried patches, so the finding stays until the next alsa-lib release, or until someone files a VEX not_affected / inline_mitigations_already_exist for pkg:github/alsa-project/alsa-lib.
  • The patch will drop itself. pkgmgr-rs#988's carried-patch check runs in update: on the first upstream release that contains f84cd4c / 1e27d63e, each patch reverse-applies and is removed automatically, together with this build.ncl entry and the build.sh line.
  • Rebuild blast radius: 24 direct importers and 34 packages transitively. That covers the whole openjdk-9 … openjdk-25 boot-JDK ladder, icedtea-7/8, jdk-21/25/27, and chromium-bin / chromium-headless-shell-bin. The ladder rebuilds serially, so expect a long CI run.

Refs gominimal/pkgmgr-rs#848

🤖 Generated with Claude Code

CVE-2026-90781 is a one-byte stack overrun in __snd_ctl_ascii_elem_id_parse
(src/control/ctlparse.c) when parsing a name= field of 64 or more
characters. It affects every release through 1.2.16.1, which is what we
ship and is still the latest. Upstream fixed it in alsa-project/alsa-lib
f84cd4ced7b3 (unreleased). Debian carries the same commit as 1.2.16.1-2.

- Carry the verbatim upstream commit as CVE-2026-90781.patch, applied with
  `patch -Np1` under `set -e` so a stale patch fails the build.
- Add a build-time regression test. It compiles ctlparse.c under
  AddressSanitizer and parses 100-character quoted and unquoted names.
  Negative control: with the patch skipped, ASan reports
  stack-buffer-overflow at ctlparse.c:239 and the build fails.
- Declare source_provenance GithubRepo alsa-project/alsa-lib. alsa-lib had
  none, so the advisory pipeline never asked about it (pkgmgr-rs#848).

Refs gominimal/pkgmgr-rs#848

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner October 17, 2026 18:56
@coderabbitai
coderabbitai Bot commented Oct 17, 2026 •
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 4 billable files and costs up to $1.00.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 15 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 58 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: gominimal/pkgs/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 85d8ec9c-da6d-45b9-8f1a-08bf39bdccf4
📥 Commits

Reviewing files that changed from the base of the PR and between 0618acc and 027f975.

📒 Files selected for processing: 4
  • packages/alsa-lib/CVE-2026-90781-numid.patch
  • packages/alsa-lib/CVE-2026-90781.patch
  • packages/alsa-lib/build.ncl
  • packages/alsa-lib/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The carried patch matches upstream f84cd4ced7b3 and applies cleanly, but it leaves one of the three overrun sites unfixed.

f84cd4ce's message says "Follows 1e27d63ef6d1". 1e27d63e ("Fix theoretical one-byte buffer overrun") fixes the same one-byte buf[64] overrun on the numid= branch, and it is not an ancestor of v1.2.16.1 (checked with git merge-base). In the packaged source, src/control/ctlparse.c:~176 still has if (size < (int)sizeof(buf)) under numid=. The patch still applies because its hunks don't touch that site.

Requested:

  • Carry 1e27d63e too.
  • Extend the ASan test (build.sh:45-55) with a long (~100 char) numid= value. It currently only exercises name=.

The provenance (alsa-project/alsa-lib is upstream's own org) and the ASan harness (never installed, fails closed) look good.


Generated by Claude Code

bryan-minimal and others added 2 commits October 21, 2026 19:05
f84cd4ce says it "follows 1e27d63ef6d1", which fixes the same one-byte
overrun of buf[64] on the numid= branch of __snd_ctl_ascii_elem_id_parse.
1e27d63e is not an ancestor of v1.2.16.1, so f84cd4ce alone left that
site open. Carry it verbatim (git format-patch) and extend the ASan
regression test with a 100-digit numid=.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
Copy link
Copy Markdown
Member Author

Thanks @norrietaylor, good catch. Both are in 027f975 (on top of a merge of main):

  1. 1e27d63e is now carried as CVE-2026-90781-numid.patch, a verbatim git format-patch. I confirmed git merge-base --is-ancestor 1e27d63e v1.2.16.1 is false and that ctlparse.c:176 still has size < (int)sizeof(buf) under numid=. Those two commits are the only ones touching ctlparse.c since the tag. With both applied, all three copy loops bound at sizeof(buf) - 1.
  2. The ASan test now also parses a 100-digit numid=. That parse is rejected as out of range (-22), but only after the copy into buf, which is the part under test.
    • Fresh pkgbuild session, both patches: builds, and prints parse(106 chars) = -22.
    • Fresh session with only the 1e27d63e line removed: fails with AddressSanitizer: stack-buffer-overflow … ctlparse.c:182 in __snd_ctl_ascii_elem_id_parse, the numid= branch. So the new case catches this site on its own.

The PR body is updated to match.

🤖 Generated with Claude Code

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this addresses it.

  • The new patch matches upstream 1e27d63ef6d1 exactly (apart from the format-patch signature line, which is cosmetic). Both patches apply cleanly to 1.2.16.1 in either order, and all three copy loops in ctlparse.c now bound by sizeof(buf) - 1.

  • I re-ran the build.sh test block against each combination of patches:

    • both: passes;
    • neither: stack-buffer-overflow;
    • f84cd4ce only: fails at ctlparse.c:182 (numid);
    • 1e27d63e only: fails at :239.

    So the new numid= case catches its own site.


Generated by Claude Code

@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 23, 2026
@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 5d50584 Oct 23, 2026
11 of 18 checks passed
@bryan-minimal
bryan-minimal deleted the alsa-lib-cve-backport branch October 23, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0