Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2029695imm; Thu, 24 May 2018 04:48:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZowf905ieMEfFYfOvhsJD379ejb/e7xAJHRIpJIuSegEniz4Rs8Bw6/oRHBnAhvvBEeBOyK X-Received: by 2002:a62:e107:: with SMTP id q7-v6mr6894257pfh.226.1527162503408; Thu, 24 May 2018 04:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527162503; cv=none; d=google.com; s=arc-20160816; b=Ubs5SrXs7YCv/DBoyJGIVi0RWVohMpFqjLrzoRkqOowKPzceBpg6Ft8yPtLcR/7GFr Dk2MylfpJ4NKFZU8828Vld2ZcyeBQTTLU+GNFKUEtQLDDcX3YKwOEy4Pxdgzjw8nMdCf T79DBZl5XFj1Bev/2HSxBSNf+9k1YvWxpn4z3lfPpAEZtf/B+Cl0+oWFJGIKKV9QWkjR /RjjcJ7mrczAyyhL3zzohFy+x/PqY3HEhATX2WhKor8wDoB73ufO+jLQlCzsxnut6QIP 6J96rS+RVsTHWA4BJsum2g4XMDCiED1Td48sT0sNX6KLM62LdQkg2bnIJBPjElGmxE45 klXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=KhPQwhqYwaZk3X1NM4oUhwBryPZXfGLTbOcISV+5fJ0=; b=yIl+OXMOKwENoq2zsHkLP3+Av3wN6eGUJf7HP8xAe81NV7YoIawzdRzdnyLJG/ojo+ Qi/SyFZzRFwJ7cvOopfuSO1DP2N60nYAnSRXUey4ktPlXJxospgAidkCNoNXsCVuPu20 Xl1RW6DSp45Pm+6veKA6lESMh6PM2zjc+8gfmiTkWFMQU52zeSPI64v0PX6Gq1Wux/P+ TEkCpNW4tGgrHtGdYCZ8pb4XDQ1aLjT+a+SdvXx8vkrF43N6g4uMTGMphNhTYlCvI11j dOuXj4mB1fC+2M6JHlhhRhxJ+inUii+C1PPgnhzFp84ls8NpjCWhjuDd1byL+YqO2dZ2 ARbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KC+QXYgx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si16991275pgc.569.2018.05.24.04.48.08; Thu, 24 May 2018 04:48:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KC+QXYgx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967242AbeEXLrV (ORCPT + 99 others); Thu, 24 May 2018 07:47:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:60220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966805AbeEXJre (ORCPT ); Thu, 24 May 2018 05:47:34 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D5E01208BA; Thu, 24 May 2018 09:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155253; bh=7m1fFnxrJ7bYutBUs8eShoqA0UcMkcOAdcl5Fk9d8qw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KC+QXYgxqrPPfV/qhfsU1DbYpl4F6vjSN7RnIKOrphWzcIPvSlI8L8XNMw/n+1RWc BSH23dLcZKmw0msbeOVvYnSHLB3kgqaSxMTPv5Th/FL0aUAiWXOlcl2fkqzgomEzXC wFm5A2hk+YPYelRpANB1rEKlCdrxh0QI+2qimvaM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+7d26fc1eea198488deab@syzkaller.appspotmail.com, Alexander Potapenko , Douglas Gilbert , Johannes Thumshirn , "Martin K. Petersen" Subject: [PATCH 4.9 19/96] scsi: sg: allocate with __GFP_ZERO in sg_build_indirect() Date: Thu, 24 May 2018 11:38:02 +0200 Message-Id: <20180524093606.702135570@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable 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 Cc: stable@vger.kernel.org Signed-off-by: Alexander Potapenko Acked-by: Douglas Gilbert Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1893,7 +1893,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;