linux-stable/sound
Takashi Iwai 5c1733e33c ALSA: memalloc: Align buffer allocations in page size
Currently the standard memory allocator (snd_dma_malloc_pages*())
passes the byte size to allocate as is.  Most of the backends
allocates real pages, hence the actual allocations are aligned in page
size.  However, the genalloc doesn't seem assuring the size alignment,
hence it may result in the access outside the buffer when the whole
memory pages are exposed via mmap.

For avoiding such inconsistencies, this patch makes the allocation
size always to be aligned in page size.

Note that, after this change, snd_dma_buffer.bytes field contains the
aligned size, not the originally requested size.  This value is also
used for releasing the pages in return.

Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201218145625.2045-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-18 17:09:10 +01:00
..
ac97
aoa
arm
atmel
core ALSA: memalloc: Align buffer allocations in page size 2020-12-18 17:09:10 +01:00
drivers
firewire
hda
i2c
isa
mips
oss
parisc
pci ALSA: hda/realtek - Supported Dell fixed type headset 2020-12-17 10:35:44 +01:00
pcmcia
ppc
sh
soc ASoC: Updates for v5.11 2020-12-14 15:57:14 +01:00
sparc
spi
synth
usb ALSA: usb-audio: Disable sample read check if firmware doesn't give back 2020-12-18 17:08:24 +01:00
x86
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c