summaryrefslogtreecommitdiff
path: root/net/ipv4/fou.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-07-19 12:01:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-22 08:46:10 +0300
commit79018e171ae5dd3178f199b7731f82e7dbdefb5f (patch)
tree58f0209003a9c50e105d3a04aea6cb8e3cce37e3 /net/ipv4/fou.c
parentfda20e719212b8b5406394b1c30db35402084c82 (diff)
downloadlinux-79018e171ae5dd3178f199b7731f82e7dbdefb5f.tar.xz
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>
Diffstat (limited to 'net/ipv4/fou.c')
0 files changed, 0 insertions, 0 deletions