Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1918624imm; Thu, 24 May 2018 02:56:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpcUZQHkCDWxjmwyxxGHGF99sp88Lwfhy9wE46f3BW2NvfkRgl88WfEvc4fc4mQ4rsvovFg X-Received: by 2002:a62:303:: with SMTP id 3-v6mr6505033pfd.255.1527155769656; Thu, 24 May 2018 02:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527155769; cv=none; d=google.com; s=arc-20160816; b=p1wrz7BikzVZ++zV7h4KEBaY8edAdNCfp14/BCInlUOfzPAz5unIVQ0GJ+TgTl+qo0 PvjagSxi9w7rQhL3XIzf2h/A6kAAGtYG6UPH9jq/l3yHotMN1hzMbxqiT4QfBFh/ilu7 Lfgl5NdhBrwoMGv2X2IklDfN2XW8c8SdsdFXeTC8ucKBN+w9V//UV+KTCdEKrtGGzOre 0b3tznwQlrDHDglPq2Ic7JsZS67QOvYM0fZyGEiMxaaJHycCTCcVK3aR3A52hn1b9vPa 6ElkNtJ6HMzmdmxn+BULxFW5ZJQn1tntruxYZiIbsfqTMpK5jJqwh2/LEtmLnZEQbVkS 13vA== 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=FMO+h2LxTKspnEtYnhGAFaWIPwzM6IJPgvvciGl1YbQ=; b=FKXxmwaGYbIzSsr0Z53wpf6el9JyqvTDdlkTAPKaCnSo2zuDhVvIrSN8TT6QXQFjYJ CYiJIy6EY1Cqvd+3dc+Go7cwVKtuk1E4n1BhkhXO+hs213B9a6X4N9uNo9/PaIeQXEfr 5Ib/yLhqpPv/UelXF8aDrca/I8r2V+vnOduVqDPo7iQ6dZnKA0S6yIw6axYcm2vAWgmT 5T5oM6FXEeD34LxLnRNoPV19VzMG5DddDQGaRsY+q7xG5bOJKt56LB8F0n+WsQTEVLu0 +cUvlMrK7Uq5itzJACBNJTsbDoDAlqSecbbo5Kw+HL/I2//4Es/0fDjUtW/JLS50dJcy PzUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FC93qlYG; 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 l16-v6si15899406pgc.177.2018.05.24.02.55.55; Thu, 24 May 2018 02:56:09 -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=FC93qlYG; 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 S968335AbeEXJy7 (ORCPT + 99 others); Thu, 24 May 2018 05:54:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:35028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968302AbeEXJyy (ORCPT ); Thu, 24 May 2018 05:54:54 -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 4022B208A0; Thu, 24 May 2018 09:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155693; bh=ocHFT9ZQD6U5PV/8JE+IZB2/KD965jEFBC2ZFw2whI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FC93qlYGC/BwYBBjZNhRHx1a+kSQb6DIGiSeoDyMPkvujwd5930ejtV7DFzuycmVP TZ3oQoIxka7nTbC17ehHhj3ZXdOptd4Q2sFZ5RQl5zktd/vPxgAaqUvnuTIDKskhw1 /3SHF8khUj8madomVvSFv5B7B20yVmnPoVDjv3l8= 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.14 047/165] scsi: sg: allocate with __GFP_ZERO in sg_build_indirect() Date: Thu, 24 May 2018 11:37:33 +0200 Message-Id: <20180524093623.931009664@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-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 @@ -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;