Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1911432imm; Thu, 24 May 2018 02:48:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpIfhv3y718JJl/oyS/7phhAXqTRqPNNTJAXL/IENoPQMxfh4xONerQxLm+hH2nS6j3GGTv X-Received: by 2002:a17:902:a60e:: with SMTP id u14-v6mr5921476plq.233.1527155280498; Thu, 24 May 2018 02:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527155280; cv=none; d=google.com; s=arc-20160816; b=eeiTEPrltWLr5ui4BHzIQNoCOJj30gZnROPpj5MRHP3gnB6eGn7j2mjB0fSY2lZf4Q mpoBW6EB1HzBgSYAMHB3swl9kcUZ4P6TJ8+/VBUmlvAzEs7Msj+f6tDzsaVe7zQ+Jrs6 s/1A3yfw80yBNIu3aQqtayGBkA7CnUQ//x3AldjD3nWP07+96K8z/+SQmEhHOxpOmefj g7FtgXGjuCQfRBkd+B8aSYWbLY4WhoyyiaYKg3aI3Fz3YvfPZGJZei302V6n0E9YjJoj uuzDkqTbSWsYf9LmblleUtOb3v62MOMfp6xiFus/8/q/6RSNxNguH2IUt51Y6XZjHx7H rghA== 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=eWtUgMMYMqm+8Fp/n8DdDdrYNZXUT2l/FW3kyhJDCIo=; b=hCWFQI0nPB9KtHGpGqHzAG3zpuavf5uoQsdtgzcRhPupGqJ33Sv961w6wBxkuUipGe H5+0CFmZoNN9xoPnQqfr81wGMr5eqT6aUqznGR8Pk3d1Cz6feY2ZTXbjhO093BnPrtJS OjY1AiHfMSJVEy58+qirbTajwSjIJmAzmml4o9mdadIBwdEr+iBjssn9K2NaWmAUCx7e HwUzfQZ1n7h/+O1whf87JXYX0NRd06XqR8F8Ng4MVODxsd85ibwkzh23jAwzLgn5swqG FkG/aZ3G5VicUDD1blX34Jp4E558jusg8FaiyL0zO/vkS8Dze8mVIXFCSZXX+23Cbs4E +4nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lbOX7a0R; 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 v11-v6si11312583pgt.356.2018.05.24.02.47.45; Thu, 24 May 2018 02:48:00 -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=lbOX7a0R; 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 S966995AbeEXJrC (ORCPT + 99 others); Thu, 24 May 2018 05:47:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:58880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966955AbeEXJqz (ORCPT ); Thu, 24 May 2018 05:46:55 -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 DBEA9208C3; Thu, 24 May 2018 09:46:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155215; bh=iZ7t7OZps4ANM67LomedvqJLO6OM7NTNyLy64cuC8vk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lbOX7a0RXN9f8JJbuyfKHzpADblAEMFdgf1DFo1oDa5yFcLgDty8Frk9RpWx6mKXB 4+jmKlNjtXHG/yDfF2Ju0g/PyeFdgCYJETYByrMihA2TngvRjHBQad53sGT+3jEoPN aImgL+IrZjr9aS6SYvFyyRfvBcIzNLj7/oFsyJQA= 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.4 85/92] scsi: sg: allocate with __GFP_ZERO in sg_build_indirect() Date: Thu, 24 May 2018 11:39:02 +0200 Message-Id: <20180524093207.405689033@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093159.286472249@linuxfoundation.org> References: <20180524093159.286472249@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.4-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 @@ -1903,7 +1903,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;