linux-stable/sound/core
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
..
oss ALSA: oss: Fix PCM OSS buffer allocation overflow 2022-03-28 09:57:08 +02:00
seq ALSA: seq: Set upper limit of processed events 2022-01-27 10:54:22 +01:00
compress_offload.c ALSA: compress_offload: remove redundant initialization 2020-09-03 09:26:27 +02:00
control.c ALSA: ctl: fix error path at adding user-defined element set 2020-11-13 11:33:55 +01:00
control_compat.c ALSA: ctl: Fix copy of updated id with element read/write 2021-12-14 11:32:38 +01:00
ctljack.c
device.c ALSA: core: Add snd_device_get_state() helper 2020-03-23 18:09:19 +01:00
hrtimer.c ALSA: timer: Replace tasklet with work 2020-09-09 18:32:52 +02:00
hwdep.c ALSA: compat_ioctl: avoid compat_alloc_user_space 2020-09-21 10:37:07 +02:00
hwdep_compat.c ALSA: compat_ioctl: avoid compat_alloc_user_space 2020-09-21 10:37:07 +02:00
info.c ALSA: info: Drop WARN_ON() from buffer NULL sanity check 2020-07-17 10:59:38 +02:00
info_oss.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
init.c ALSA: core: remove redundant spin_lock pair in snd_card_disconnect 2021-05-14 09:50:31 +02:00
isadma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jack.c ALSA: jack: Access input_dev under mutex 2022-06-09 10:20:51 +02:00
Kconfig ALSA: control: Add verification for kctl accesses 2020-01-04 09:37:59 +01:00
Makefile ALSA: ISA: not for M68K 2021-11-26 10:39:10 +01:00
memalloc.c ALSA: memalloc: Align buffer allocations in page size 2022-07-29 17:19:25 +02:00
memory.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
misc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pcm.c ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock 2022-04-08 14:39:53 +02:00
pcm_compat.c ALSA: pcm: Workaround for a wrong offset in SYNC_PTR compat ioctl 2021-10-20 11:44:57 +02:00
pcm_dmaengine.c ALSA: fix kernel-doc markups 2020-10-26 15:26:31 +01:00
pcm_drm_eld.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pcm_iec958.c ALSA: core: pcm_iec958: fix kernel-doc 2020-07-07 10:22:33 +02:00
pcm_lib.c ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock 2022-04-08 14:39:53 +02:00
pcm_local.h ALSA: pcm: Call sync_stop at disconnection 2021-03-04 11:37:19 +01:00
pcm_memory.c ALSA: pcm: Check for null pointer of pointer substream before dereferencing it 2022-06-09 10:21:03 +02:00
pcm_misc.c ALSA: pcm: Test for "silence" field in struct "pcm_format_data" 2022-04-20 09:23:27 +02:00
pcm_native.c ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock 2022-04-08 14:39:53 +02:00
pcm_param_trace.h
pcm_timer.c ALSA: timer: Constify snd_timer_hardware definitions 2020-01-03 09:24:07 +01:00
pcm_trace.h
rawmidi.c ALSA: rawmidi: Access runtime->avail always in spinlock 2021-01-06 14:56:52 +01:00
rawmidi_compat.c ALSA: Avoid using timespec for struct snd_rawmidi_status 2019-12-11 22:06:16 +01:00
seq_device.c ALSA: seq: Fix a potential UAF by wrong private_free call order 2021-10-20 11:44:57 +02:00
sgbuf.c ALSA: memalloc: Make SG-buffer helper usable for continuous buffer, too 2020-06-15 18:01:52 +02:00
sound.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
sound_oss.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
timer.c ALSA: timer: Unconditionally unlink slave instances, too 2021-11-18 14:03:40 +01:00
timer_compat.c ALSA: Avoid using timespec for struct snd_timer_tread 2019-12-13 11:25:57 +01:00
vmaster.c ALSA: Replace the word "slave" in vmaster API 2020-07-20 10:10:47 +02:00