android_kernel_samsung_univ.../sound/core
Takashi Iwai dd65a18b20 ALSA: memalloc: Don't exceed over the requested size
commit dfef01e150824b0e6da750cacda8958188d29aea upstream.

snd_dma_alloc_pages_fallback() tries to allocate pages again when the
allocation fails with reduced size.  But the first try actually
*increases* the size to power-of-two, which may give back a larger
chunk than the requested size.  This confuses the callers, e.g. sgbuf
assumes that the size is equal or less, and it may result in a bad
loop due to the underflow and eventually lead to Oops.

The code of this function seems incorrectly assuming the usage of
get_order().  We need to decrease at first, then align to
power-of-two.

Reported-and-tested-by: he, bo <bo.he@intel.com>
Reported-by: zhang jun <jun.zhang@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-22 07:48:36 +02:00
..
oss ALSA: pcm: Fix endless loop for XRUN recovery in OSS emulation 2018-04-24 09:32:09 +02:00
seq ALSA: virmidi: Fix too long output trigger loop 2018-08-22 07:48:36 +02:00
compress_offload.c
control_compat.c ALSA: control: fix a redundant-copy issue 2018-05-26 08:48:52 +02:00
control.c
ctljack.c
device.c
hrtimer.c
hwdep_compat.c
hwdep.c
info_oss.c
info.c
init.c
isadma.c
jack.c
Kconfig
Makefile
memalloc.c ALSA: memalloc: Don't exceed over the requested size 2018-08-22 07:48:36 +02:00
memory.c
misc.c
pcm_compat.c ALSA: pcm: Check PCM state at xfern compat ioctl 2018-05-16 10:06:47 +02:00
pcm_dmaengine.c
pcm_drm_eld.c
pcm_iec958.c
pcm_lib.c ALSA: pcm: Remove yet superfluous WARN_ON() 2018-01-23 19:50:14 +01:00
pcm_memory.c
pcm_misc.c
pcm_native.c ALSA: core: Report audio_tstamp in snd_pcm_sync_ptr 2018-05-02 07:53:41 -07:00
pcm_timer.c
pcm_trace.h
pcm.c ALSA: pcm: Fix UAF at PCM release via PCM timer access 2018-04-24 09:32:07 +02:00
rawmidi_compat.c ALSA: rawmidi: Fix missing input substream checks in compat ioctls 2018-04-24 09:32:10 +02:00
rawmidi.c ALSA: rawmidi: Change resized buffers atomically 2018-07-25 10:18:15 +02:00
rtctimer.c
sgbuf.c
sound_oss.c
sound.c
timer_compat.c ALSA: timer: Remove kernel warning at compat ioctl error paths 2017-11-30 08:37:22 +00:00
timer.c ALSA: timer: Fix pause event notification 2018-05-30 07:48:51 +02:00
vmaster.c ALSA: vmaster: Propagate slave error 2018-05-30 07:49:13 +02:00