* [PATCH] ALSA: control: Clear user-provided numid before adding a control
@ 2026-11-02 13:50 Sreeraj S Kurup
2026-11-03 14:53 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Sreeraj S Kurup @ 2026-11-02 13:50 UTC (permalink / raw)
To: perex, tiwai
Cc: cezary.rojewski, phucduc.bui, kees+treewide,
cassiogabrielcontato, mstrozek, linux-sound, linux-kernel,
Sreeraj S Kurup
Clear the user-provided numid before checking for duplicate controls.
A non-existing numid can cause the duplicate control ID check to be
skipped, allowing a control with the same name and index to be added.
Since the kernel assigns the numid when adding a control,
ignore the value provided by userspace.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
sound/core/control.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/core/control.c b/sound/core/control.c
index 535ceba294ac..42f16d2d0e79 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1759,9 +1759,10 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
if (strnlen(info->id.name, sizeof(info->id.name)) >= sizeof(info->id.name))
return -EINVAL;
+ info->id.numid = 0;
+
/* Delete a control to replace them if needed. */
if (replace) {
- info->id.numid = 0;
err = snd_ctl_remove_user_ctl(file, &info->id);
if (err)
return err;
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: control: Clear user-provided numid before adding a control
2026-11-02 13:50 [PATCH] ALSA: control: Clear user-provided numid before adding a control Sreeraj S Kurup
@ 2026-11-03 14:53 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-11-03 14:53 UTC (permalink / raw)
To: Sreeraj S Kurup
Cc: perex, tiwai, cezary.rojewski, phucduc.bui, kees+treewide,
cassiogabrielcontato, mstrozek, linux-sound, linux-kernel
On Mon, 02 Nov 2026 14:50:34 +0100,
Sreeraj S Kurup wrote:
>
> Clear the user-provided numid before checking for duplicate controls.
>
> A non-existing numid can cause the duplicate control ID check to be
> skipped, allowing a control with the same name and index to be added.
>
> Since the kernel assigns the numid when adding a control,
> ignore the value provided by userspace.
>
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-03 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 13:50 [PATCH] ALSA: control: Clear user-provided numid before adding a control Sreeraj S Kurup
2026-11-03 14:53 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®