linux-stable/sound
Takashi Iwai 4faf4bbc2d ALSA: memalloc: Align buffer allocations in page size
commit 5c1733e33c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-29 17:19:25 +02:00
..
ac97 ALSA: ac97: fix PM reference leak in ac97_bus_remove() 2021-07-20 16:05:40 +02:00
aoa ALSA: aoa: i2sbus: use DECLARE_COMPLETION_ONSTACK() macro 2020-09-03 09:26:52 +02:00
arm amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
atmel ALSA: atmel: ac97: clarify operator precedence 2020-09-03 09:27:34 +02:00
core ALSA: memalloc: Align buffer allocations in page size 2022-07-29 17:19:25 +02:00
drivers ALSA: drivers: opl3: Fix incorrect use of vp->state 2021-12-29 12:26:00 +01:00
firewire ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes 2022-05-12 12:25:29 +02:00
hda ALSA: hda/realtek - Add HW8326 support 2022-06-22 14:13:15 +02:00
i2c
isa ALSA: wavefront: Proper check of get_user() error 2022-05-25 09:17:55 +02:00
mips hal2: convert to dma_alloc_noncoherent 2020-09-25 06:20:44 +02:00
oss
parisc
pci ALSA: hda/realtek - Enable the headset-mic on a Xiaomi's laptop 2022-07-21 21:19:59 +02:00
pcmcia
ppc ALSA: ppc: fix error return code in snd_pmac_probe() 2021-07-20 16:05:43 +02:00
sh
soc ASoC: madera: Fix event generation for rate controls 2022-07-21 21:20:16 +02:00
sparc ALSA: sparc: dbri: fix repeated word 'the' 2020-10-17 09:58:35 +02:00
spi ALSA: spi: Add check for clk_enable() 2022-04-08 14:40:08 +02:00
synth ALSA: synth: missing check for possible NULL after the call to kstrdup 2021-11-18 14:03:40 +01:00
usb ALSA: usb-audio: Cancel pending work at closing a MIDI substream 2022-06-09 10:20:48 +02:00
x86 ALSA: intel_hdmi: Fix reference to PCM buffer address 2022-03-08 19:09:31 +01:00
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c