[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241211185028.3841047-10-sashal@kernel.org>
Date: Wed, 11 Dec 2024 13:49:26 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Takashi Iwai <tiwai@...e.de>,
Sasha Levin <sashal@...nel.org>,
perex@...ex.cz,
tiwai@...e.com,
zhangjiao2@...s.chinamobile.com,
andriy.shevchenko@...ux.intel.com,
luoyifan@...s.chinamobile.com,
linux-sound@...r.kernel.org
Subject: [PATCH AUTOSEL 6.12 10/36] ALSA: ump: Don't open legacy substream for an inactive group
From: Takashi Iwai <tiwai@...e.de>
[ Upstream commit 3978d53df7236f0a517c2abeb43ddf6ac162cdd8 ]
When a UMP Group is inactive, we shouldn't allow users to access it
via the legacy MIDI access. Add the group active flag check and
return -ENODEV if it's inactive.
Link: https://patch.msgid.link/20241129094546.32119-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@...e.de>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
sound/core/ump.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/core/ump.c b/sound/core/ump.c
index 8d37f237f83b2..0ade67d6b0896 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -1087,6 +1087,8 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream)
guard(mutex)(&ump->open_mutex);
if (ump->legacy_substreams[dir][group])
return -EBUSY;
+ if (!ump->groups[group].active)
+ return -ENODEV;
if (dir == SNDRV_RAWMIDI_STREAM_OUTPUT) {
if (!ump->legacy_out_opens) {
err = snd_rawmidi_kernel_open(&ump->core, 0,
--
2.43.0
Powered by blists - more mailing lists