scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
authorAlexander Potapenko <glider@google.com>
Fri, 18 May 2018 14:23:18 +0000 (16:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:34 +0000 (16:17 +0200)
commitd827bea2d18c07ba514f7d48cde49f90da9a1384
tree404d49a0de08ee22c5b384354e6e8eb74be555b5
parent58442874542fb41fd53de4ab34be180ad43779c9
scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()

commit a45b599ad808c3c982fdcdc12b0b8611c2f92824 upstream.

This shall help avoid copying uninitialized memory to the userspace when
calling ioctl(fd, SG_IO) with an empty command.

Reported-by: syzbot+7d26fc1eea198488deab@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Potapenko <glider@google.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/sg.c