From: Omer Cohen <nevergfx1@gmail.com>
To: tiwai@suse.de, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, security@kernel.org,
Omer Cohen <nevergfx1@gmail.com>,
stable@vger.kernel.org
Subject: [PATCH 6/6] ALSA: rawmidi: propagate resize_runtime_buffer() error in input_params
Date: Fri, 26 Jun 2026 16:47:09 +0300 [thread overview]
Message-ID: <20260626134709.27883-7-nevergfx1@gmail.com> (raw)
In-Reply-To: <20260626134709.27883-1-nevergfx1@gmail.com>
snd_rawmidi_input_params() calls resize_runtime_buffer() but ignores
its return value, unconditionally returning 0. This silently swallows
-ENOMEM (allocation failure), -EINVAL (invalid parameters), and -EBUSY
(buffer in use).
When resize fails, the framing and clock_type parameters are still
applied to the substream, but the buffer remains at its old size.
This leaves the stream in an inconsistent state where the configured
framing mode does not match the buffer layout.
Return the error from resize_runtime_buffer().
Fixes: 08fdced60ca0 ("ALSA: rawmidi: Add framing mode")
Cc: stable@vger.kernel.org
Reported-by: Omer Cohen <nevergfx1@gmail.com>
Signed-off-by: Omer Cohen <nevergfx1@gmail.com>
---
sound/core/rawmidi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index XXXXXXXXXXXX..XXXXXXXXXXXX 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -784,7 +784,7 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
substream->framing = framing;
substream->clock_type = clock_type;
}
- return 0;
+ return err;
}
EXPORT_SYMBOL(snd_rawmidi_input_params);
--
2.43.0
next prev parent reply other threads:[~2026-06-30 11:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 13:47 [PATCH 0/6] ALSA: sound/core: fix multiple data races and bugs Omer Cohen
2026-06-26 13:47 ` [PATCH 1/6] ALSA: compress: remove illegal state mutation in poll() Omer Cohen
2026-06-26 13:47 ` [PATCH 2/6] ALSA: compress: fix buffer leak on set_params driver failure Omer Cohen
2026-06-26 13:47 ` [PATCH 3/6] ALSA: timer: fix lockless tu->tread read in snd_timer_user_read() Omer Cohen
2026-06-26 13:47 ` [PATCH 4/6] ALSA: timer: copy queue entries to local buffer before copy_to_user Omer Cohen
2026-06-26 13:47 ` [PATCH 5/6] ALSA: pcm: use locked state read in snd_pcm_drop() Omer Cohen
2026-06-26 13:47 ` Omer Cohen [this message]
2026-07-02 7:30 ` [PATCH 0/6] ALSA: sound/core: fix multiple data races and bugs Takashi Iwai
2026-07-02 7:41 ` Omer Cohen
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=20260626134709.27883-7-nevergfx1@gmail.com \
--to=nevergfx1@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=security@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.