[PATCH RESEND v2 22/51] ALSA: info: don't write past the end of a data entry
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 5 11:29:32 PST 2026
> snd_info_entry_write() clamps the count to what is left of the entry
> by computing entry->size - pos as a size_t. For a position past the end
> that wraps and the write goes to the driver unclamped, for opl4 into
> sample memory outside of what the entry covers. At the end of the entry
> the driver gets a count of 0 and vmalloc(0) warns. Before the clamp
> moved into the common code the driver ignored such writes. Fail them
> with -ENOSPC instead, like a block device does at the end of the
> device. Returning 0 would make writers that use stdio retry forever.
>
> Fixes: d97e1b78239c ("ALSA: info - Check file position validity in common layer")
> Reviewed-by: Takashi Iwai <tiwai at suse.de>
> Cc: stable at vger.kernel.org
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-work-procfs-bugfixes-v2-0-021c84d852e0@kernel.org?part=22
More information about the kexec
mailing list