[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180524093026.158541287@linuxfoundation.org>
Date: Thu, 24 May 2018 11:38:09 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
syzbot+7d26fc1eea198488deab@...kaller.appspotmail.com,
Alexander Potapenko <glider@...gle.com>,
Douglas Gilbert <dgilbert@...erlog.com>,
Johannes Thumshirn <jthumshirn@...e.de>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Subject: [PATCH 4.16 064/161] scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Potapenko <glider@...gle.com>
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@...kaller.appspotmail.com
Cc: stable@...r.kernel.org
Signed-off-by: Alexander Potapenko <glider@...gle.com>
Acked-by: Douglas Gilbert <dgilbert@...erlog.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@...e.de>
Signed-off-by: Martin K. Petersen <martin.petersen@...cle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/scsi/sg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1894,7 +1894,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;
Powered by blists - more mailing lists