summaryrefslogtreecommitdiff
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-02 20:07:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-23 08:18:35 +0100
commit81b83ca3e45b83e632b8063cd27bdb072ecfc135 (patch)
tree8b1f159492638b5b66e68d079e8563bed1ea8bed /mm/page_alloc.c
parente2c48c1e6ef5e806b68ca685216dda05e5267be2 (diff)
ALSA: line6: Fix write on zero-sized buffer
commit 3450121997ce872eb7f1248417225827ea249710 upstream. LINE6 drivers allocate the buffers based on the value returned from usb_maxpacket() calls. The manipulated device may return zero for this, and this results in the kmalloc() with zero size (and it may succeed) while the other part of the driver code writes the packet data with the fixed size -- which eventually overwrites. This patch adds a simple sanity check for the invalid buffer size for avoiding that problem. Reported-by: syzbot+219f00fb49874dcaea17@syzkaller.appspotmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de> [bwh: Backported to 4.4: Driver doesn't support asymmetrical packet sizes, so only check snd_line6_pcm::max_packet_size] Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/page_alloc.c')
0 files changed, 0 insertions, 0 deletions