Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/4] ALSA: compress: fix buffer handling and state validation
@ 2026-10-07 13:25 Peter Ujfalusi
  2026-10-07 13:25 ` [PATCH 1/4] ALSA: compress: fix buffer leak on repeated SET_PARAMS Peter Ujfalusi
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Peter Ujfalusi @ 2026-10-07 13:25 UTC (permalink / raw)
  To: vkoul, perex, tiwai; +Cc: pierre-louis.bossart, linux-sound, stable

Hi,

The compress offload core has several edge cases in buffer management
and state validation.

Repeated SET_PARAMS while a stream is OPEN can replace a framework-owned
buffer without freeing it. During gapless playback, SET_PARAMS can also
change the buffer geometry while the byte counters still refer to the
previous buffer. Separately, SET_METADATA can reach the driver before
SET_PARAMS, and the origin_seqno task lookup can restart a task that is
still ACTIVE.

Address these cases by:
- freeing a prior framework-owned buffer before replacing it;
- rejecting buffer geometry changes on the gapless next_track path;
- rejecting SET_METADATA while the stream is OPEN; and
- allowing origin_seqno to reuse IDLE or FINISHED tasks, but not ACTIVE
  ones.

Regards,
Peter
---
Peter Ujfalusi (4):
  ALSA: compress: fix buffer leak on repeated SET_PARAMS
  ALSA: compress: reject buffer geometry change on gapless next_track
  ALSA: compress: add missing OPEN-state gate to SET_METADATA
  ALSA: compress: reject restarting an ACTIVE task via origin_seqno

 sound/core/compress_offload.c | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

-- 
2.56.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-10-08  7:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07 13:25 [PATCH 0/4] ALSA: compress: fix buffer handling and state validation Peter Ujfalusi
2026-10-07 13:25 ` [PATCH 1/4] ALSA: compress: fix buffer leak on repeated SET_PARAMS Peter Ujfalusi
2026-10-07 14:04   ` Takashi Iwai
2026-10-07 14:10     ` Vinod Koul
2026-10-07 14:25       ` Péter Ujfalusi
2026-10-07 14:37         ` Vinod Koul
2026-10-08  6:25           ` Péter Ujfalusi
2026-10-08  7:57             ` Péter Ujfalusi
2026-10-08  7:54     ` Péter Ujfalusi
2026-10-07 14:08   ` Vinod Koul
2026-10-07 13:25 ` [PATCH 2/4] ALSA: compress: reject buffer geometry change on gapless next_track Peter Ujfalusi
2026-10-07 14:12   ` Vinod Koul
2026-10-07 13:25 ` [PATCH 3/4] ALSA: compress: add missing OPEN-state gate to SET_METADATA Peter Ujfalusi
2026-10-07 14:12   ` Vinod Koul
2026-10-07 13:25 ` [PATCH 4/4] ALSA: compress: reject restarting an ACTIVE task via origin_seqno Peter Ujfalusi
2026-10-07 14:14   ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox