Android security tags, read closely by Lightrion

CVE-2024-23709 AI-generated analysis

platform/external/sonivox, arm-wt-22k wavetable synth engine (eas_wtsynth.c, eas_wtengine.c)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (5 corrections). Verify against the commit before relying on it.

Clamps the per-frame sample count in the sonivox wavetable synthesizer to BUFFER_SIZE_IN_MONO_SAMPLES, both where it is computed (WT_CheckSampleEnd in eas_wtsynth.c) and in each engine routine that uses it (eas_wtengine.c), so the gain, interpolation and filter loops cannot run past the frame audio and mix buffers.

Root cause

When a voice is about to reach loopEnd, WT_CheckSampleEnd in arm-wt-22k/lib_src/eas_wtsynth.c computes pWTIntFrame->numSamples as 1 + (numSamples / phaseIncrement), or uses the raw value when phaseIncrement is 0. It rejected only a negative result (the existing b/26366256 check) and had no upper bound. The engine routines in eas_wtengine.c (WT_VoiceGain, WT_Interpolate, WT_InterpolateNoLoop, WT_VoiceFilter, WT_InterpolateMono) copy pWTIntFrame->numSamples into a local count and also check only for <= 0 before processing pWTIntFrame->pAudioBuffer and/or pMixBuffer. WT_VoiceGain, for example, loops while(numSamples--) over both buffers. A count larger than the frame buffer size (BUFFER_SIZE_IN_MONO_SAMPLES) can therefore drive accesses past those buffers.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to May 2024 · Findings