Re: [PATCH 3/3] ALSA: pcm: Clear mmap tail padding to avoid info leak
From: Takashi Iwai
Date: Wed Dec 02 2026 - 10:31:39 EST
On Wed, 02 Dec 2026 15:01:17 +0100,
Ahmed Abdelmoemen wrote:
>
> snd_pcm_mmap_data() validates the request against
> PAGE_ALIGN(runtime->dma_bytes), so when the logical buffer is smaller
> than a page (e.g. 512 bytes via OSS SETFRAGMENT) userspace may map the
> whole page. The tail padding is backed by the same page and may hold
> data from prior use of the buffer. hw_params zeroes
> PAGE_ALIGN(dma_bytes) for MMAP-capable streams, but a stream mapped
> through the OSS path can be exposed without that memset having run.
Hmm, how does it happen?
Takashi