Re: [PATCH] ALSA: seq: oss: Reject reads that cannot fit the next event
From: Takashi Iwai
Date: Tue Jun 02 2026 - 14:05:45 EST
On Tue, 02 Jun 2026 13:18:39 +0200,
Cássio Gabriel wrote:
>
> snd_seq_oss_read() checks whether the next queued OSS sequencer event
> fits in the remaining userspace buffer before removing it from the read
> queue.
>
> The check is inverted. It currently stops when the event is smaller than
> the remaining buffer, so a normal 4-byte event is not copied for an
> 8-byte read buffer. Conversely, an 8-byte event can be copied for a
> smaller read count.
>
> Break only when the remaining userspace buffer is smaller than the next
> event, and report -EINVAL if no complete event has been copied. This
> prevents an undersized read from looking like end-of-file while leaving
> the event queued for a later read with a large enough buffer.
>
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>
Applied to for-next branch now. Thanks.
Takashi