From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.dev,
linux-sound@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/4] ALSA: compress: fix buffer leak on repeated SET_PARAMS
Date: Thu, 8 Oct 2026 10:57:52 +0300 [thread overview]
Message-ID: <57be379a-f230-4e5a-9f23-19d21142a33a@linux.intel.com> (raw)
In-Reply-To: <1acd072e-2b87-4083-84cb-9de6252b4382@linux.intel.com>
On 08/10/2026 09:25, Péter Ujfalusi wrote:
>>>> I would block calling snd_compr_allocate_buffer() for subsequent
>>>> set_params, it should not be allowed.
>>>
>>> OK, let me see how it should be done. I'm not sure of changing other
>>> params are permitted either, but imagine:
>>
>> I would split it up for next_track and open, so that we have clear
>> flows.
>>
>>> the application calls set_params first then after some deliberation and
>>> before starting it reconsiders and wants to have bigger/smaller buffer.
>>> I know, they rarely do, but if such application assumes that the second
>>> buffer setup is valid, while we kept the initial one, things might break?
>>
>> Hmmm, do we really want that. they can tear down and reopen in that
>> case?
>>
>> If we split as above, in next_track case we can apply codec params while
>> ignoring buffer.. wdyt
>
> What if we just refuse consequent set_params in OPEN state?
> That does not make much sense and can collapse patch 1 and 2 into one.
tried several other ways on this (patch 2 included) and at the end I
have ended up with the exact same patches.
Two separate issues and the two patch covers the points well.
The set_params in OPEN state is sticking out, but I think that allowing
it to re-allocate memory is the right thing:
this can only happen if the stream->ops->set_params(stream, params);
fails and in that case user space might want to try different memory layout.
I would leave the series unchanged.
--
Péter
next prev parent reply other threads:[~2026-10-08 7:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=57be379a-f230-4e5a-9f23-19d21142a33a@linux.intel.com \
--to=peter.ujfalusi@linux.intel.com \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
--cc=vkoul@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox