Re: [PATCH] ALSA: mixer: oss: Fix uninitialized index in recsrc ioctls
From: Takashi Iwai
Date: Wed Nov 04 2026 - 09:46:37 EST
On Wed, 04 Nov 2026 08:56:42 +0100,
songxiebing wrote:
>
> From: Bob Song <songxiebing@xxxxxxxxxx>
>
> snd_mixer_oss_get_recsrc2() returns success without setting active_index
> when the current Capture Source does not match any OSS mixer slot.
> snd_mixer_oss_get_recsrc() then uses that uninitialized index for
> "1 << index", and snd_mixer_oss_set_recsrc() does the same while ignoring
> the callback's return value.
>
> Make get_recsrc2() return -ENOENT if no slot matches, only use the
> returned index in set_recsrc() when the lookup succeeds, and initialize
> the index variables as a defensive measure.
>
> Signed-off-by: Bob Song <songxiebing@xxxxxxxxxx>
I guess that the error is rather hypothetical and not triggered by the
current use case?
As it doesn't look like an urgent fix, I applied to for-next branch
now. Thanks.
Takashi