From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-f72.google.com ([209.85.166.72]:40279 "EHLO mail-io1-f72.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392097AbeIVGKw (ORCPT ); Sat, 22 Sep 2018 02:10:52 -0400 Received: by mail-io1-f72.google.com with SMTP id p22-v6so26125471ioh.7 for ; Fri, 21 Sep 2018 17:19:36 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 21 Sep 2018 17:19:35 -0700 In-Reply-To: Message-ID: <000000000000025c4a05766ab6be@google.com> Subject: Re: [PATCH 3.16 20/63] scsi: sg: allocate with __GFP_ZERO in sg_build_indirect() From: syzbot To: Ben Hutchings Cc: akpm@linux-foundation.org, ben@decadent.org.uk, dgilbert@interlog.com, glider@google.com, jthumshirn@suse.de, linux-kernel@vger.kernel.org, martin.petersen@oracle.com, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes Sender: stable-owner@vger.kernel.org List-ID: > 3.16.58-rc1 review patch. If anyone has any objections, please let me > know. > ------------------ > From: Alexander Potapenko > 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 > Signed-off-by: Alexander Potapenko > Acked-by: Douglas Gilbert > Reviewed-by: Johannes Thumshirn > Signed-off-by: Martin K. Petersen > Signed-off-by: Ben Hutchings > --- > drivers/scsi/sg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > --- a/drivers/scsi/sg.c > +++ b/drivers/scsi/sg.c > @@ -1825,7 +1825,7 @@ retry: > num = (rem_sz > scatter_elem_sz_prev) ? > scatter_elem_sz_prev : rem_sz; > - schp->pages[k] = alloc_pages(gfp_mask, order); > + schp->pages[k] = alloc_pages(gfp_mask | __GFP_ZERO, order); > if (!schp->pages[k]) > goto out; Can't find the corresponding bug.