linux-stable/sound
Takashi Iwai 19241a56c5 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:06:51 +02:00
..
aoa ALSA: aoa: onyx: always initialize register read value 2020-01-27 14:46:41 +01:00
arm License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel ASoC: Updates for v4.14 2017-09-04 14:50:49 +02:00
core ALSA: memalloc: Align buffer allocations in page size 2022-07-29 17:06:51 +02:00
drivers ALSA: drivers: opl3: Fix incorrect use of vp->state 2021-12-29 12:17:35 +01:00
firewire ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes 2022-05-12 12:17:09 +02:00
hda ALSA: hda: avoid write to STATESTS if controller is in reset 2021-10-27 09:51:41 +02:00
i2c ALSA: i2c/cs8427: Fix int to char conversion 2019-12-01 09:13:39 +01:00
isa ALSA: wavefront: Proper check of get_user() error 2022-05-25 08:41:19 +02:00
mips
oss License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
parisc License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci ALSA: hda/conexant: Apply quirk for another HP ProDesk 600 G3 model 2022-07-21 20:42:43 +02:00
pcmcia ALSA: vxpocket: Fix invalid endian conversions 2018-08-22 07:46:10 +02:00
ppc ALSA: ppc: fix error return code in snd_pmac_probe() 2021-07-20 16:17:50 +02:00
sh ALSA: sh: Fix compile warning wrt const 2020-02-28 16:36:02 +01:00
soc ASoC: wm5110: Fix DRE control 2022-07-21 20:42:47 +02:00
sparc ALSA: sparc: Fix invalid snd_free_pages() at error path 2018-12-05 19:41:24 +01:00
spi ALSA: spi: Add check for clk_enable() 2022-04-20 09:08:14 +02:00
synth ALSA: synth: missing check for possible NULL after the call to kstrdup 2021-11-26 11:40:21 +01:00
usb ALSA: usb-audio: Fix undefined behavior due to shift overflowing the constant 2022-04-27 13:15:30 +02:00
x86 ALSA: intel_hdmi: Fix reference to PCM buffer address 2022-03-08 19:01:56 +01:00
ac97_bus.c
Kconfig
last.c
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sound_core.c sound: fix a memory leak bug 2019-08-16 10:13:46 +02:00