Skip to content

platform: posix: clk: use the only registered clock index - #11274

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/platform/posix/fix_clk_index
Oct 8, 2026
Merged

lgirdwood merged 1 commit into
thesofproject:mainfrom
tmleman:topic/upstream/pr/platform/posix/fix_clk_index

Conversation

@tmleman

@tmleman tmleman commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

posix_clk_init() registers a single clock_info with a single frequency entry, but CPU_LPRO_FREQ_IDX / CPU_LOWEST_FREQ_IDX were defined as 1. basefw_config() passes CPU_LOWEST_FREQ_IDX to clock_get_freq(), which computes clocks_get() + 1 and reads one struct past the table:

  SEGV on unknown address 0x40b1fc80 (READ)
  #0 clock_get_freq  src/lib/clk.c:48
  #1 basefw_config   src/audio/base_fw.c:163

Found by libFuzzer IPC4/ASan.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The corrected index matches the POSIX clock table and resolves the reported invalid access.

Review effort: Balanced
Findings: None

What changed in this PR

Corrects the POSIX CPU frequency index to prevent an out-of-bounds clock-table access in basefw_config().

Changes:

  • Sets the sole POSIX CPU frequency index to 0.
File Description
src/​platform/​posix/​include/​platform/​lib/​clk.h Aligns the frequency index with the single registered clock entry.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

posix_clk_init() registers a single clock_info with a single frequency
entry, but CPU_LPRO_FREQ_IDX / CPU_LOWEST_FREQ_IDX were defined as 1.
basefw_config() passes CPU_LOWEST_FREQ_IDX to clock_get_freq(), which
computes clocks_get() + 1 and reads one struct past the table:

      SEGV on unknown address 0x40b1fc80 (READ)
      #0 clock_get_freq  src/lib/clk.c:48
      thesofproject#1 basefw_config   src/audio/base_fw.c:163

Found by libFuzzer IPC4/ASan.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
@intel-sofci

Copy link
Copy Markdown

PR 11274: test results

Run date: 2026-10-06 15:05 UTC

Tested commit: 1c783f663e81aeddd0d83de9864d17f725866f29

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@lgirdwood
lgirdwood merged commit c6e2c4b into thesofproject:main Oct 8, 2026
47 of 49 checks passed
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.

4 participants