From: Takashi Iwai <tiwai@suse.de>
To: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
perex@perex.cz, tiwai@suse.com, tiwai@suse.de
Subject: Re: [PATCH v2] ALSA: control: Synchronize LED mode accesses
Date: Sat, 07 Nov 2026 10:09:59 +0100 [thread overview]
Message-ID: <87eccxyplk.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261106183953.2762-1-sreekuttan2156239@gmail.com>
On Fri, 06 Nov 2026 19:39:53 +0100,
Sreeraj S Kurup wrote:
>
> mode_store() updates led->mode while holding
> snd_ctl_led_mutex.
>
> However, snd_ctl_led_set_state() and mode_show() read this
> field without holding the same mutex.
>
> This can cause a data race when userspace changes the mode
> while another path reads it.
>
> Read the mode under snd_ctl_led_mutex in
> snd_ctl_led_set_state() and use the local value after
> releasing the mutex.
>
> Also protect the mode read in mode_show() with the mutex.
>
> Fixes: cb17fe0045aa ("ALSA: control - add sysfs support to the LED trigger module")
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
As this sort of data race for a single value has no much impact on the
actual behavior, it's more or less just for consistency.
So I applied to for-next branch. Thanks.
Takashi
prev parent reply other threads:[~2026-11-07 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 18:08 [PATCH] " Sreeraj S Kurup
2026-11-06 18:39 ` [PATCH v2] " Sreeraj S Kurup
2026-11-07 9:09 ` Takashi Iwai [this message]
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=87eccxyplk.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=sreekuttan2156239@gmail.com \
--cc=tiwai@suse.com \
/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
all inboxes | Powered by JetHome®