From patchwork Thu Apr 11 19:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10896745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E19071708 for ; Thu, 11 Apr 2019 19:31:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C551828DA3 for ; Thu, 11 Apr 2019 19:31:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B98C528DA7; Thu, 11 Apr 2019 19:31:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 70EFC28DA3 for ; Thu, 11 Apr 2019 19:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=imRC4klu0BHtCcmygoNcihfoOqnu8o09YJu1eiqHYZ8=; b=AAJGREeCN3+dJM dE1K38M2XDrf47FH5vKi6ytnQQoSCDpJr1OK+2rspivEF4EBLcPKbbmNzmol+mN8S/GTY7CYJ+tEi Lmrc1d01vGk6oyheP2FT6qZzTdN26gQkXX3VqP4OAYxtI/+9WhUjwg3n2F/xVXqBmoaF64xGfSxhV 7O2WwFLQVSX6LqrOdqZ43cGewToV+jOfh/01vtjxlcxX1MXWsUoU7faou9Lx7bHl1uIbDK7TzU4DP HLdZjqw/2Q1Q4XNJmCUgRG43udqcYcg2CNy28TpEAoCs4jnu9XfX4VtZXD3DpVxTamL7anwl2S85r Obn0GhcT1ur2pgJmtVEg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEfPv-0005JK-Te; Thu, 11 Apr 2019 19:31:23 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEfPt-0005Iu-A7 for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2019 19:31:22 +0000 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB8EF206BA; Thu, 11 Apr 2019 19:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555011081; bh=ycO9yGHUX+7rVRcrLCRFLTp3y2AZo4I1kFRK4y83NAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZIr1QirXMr4zf+bzOukody9xmdqxnZchuRy+QI6v8+BiE7dmuYuHFWtIPu9kil/O iPaS6bhOwJO3+Gqij8dxjmVJPJws8N7e1dosXN62V0pI2D7qNo4qYQ4x/W6w6V7kN+ USubL0sTI/DSOWcu4x+kb6/lz/B6gSIeSgrWXKHc= From: Eric Biggers To: linux-crypto@vger.kernel.org, Herbert Xu Subject: [PATCH] crypto: testmgr - allocate buffers with __GFP_COMP Date: Thu, 11 Apr 2019 12:28:27 -0700 Message-Id: <20190411192827.72551-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190411192607.GD225654@gmail.com> References: <20190411192607.GD225654@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190411_123121_369730_5EA9AD5E X-CRM114-Status: GOOD ( 11.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kees Cook , Rik van Riel , Linux Kernel Mailing List , linux-security-module , Geert Uytterhoeven , Dmitry Vyukov , Laura Abbott , Linux ARM Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers This is needed so that CONFIG_HARDENED_USERCOPY_PAGESPAN=y doesn't incorrectly report a buffer overflow when the destination of copy_from_iter() spans the page boundary in the 2-page buffer. Fixes: 3f47a03df6e8 ("crypto: testmgr - add testvec_config struct and helper functions") Signed-off-by: Eric Biggers Reviewed-by: Kees Cook --- crypto/testmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 0f6bfb6ce6a46..3522c0bed2492 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -156,7 +156,8 @@ static int __testmgr_alloc_buf(char *buf[XBUFSIZE], int order) int i; for (i = 0; i < XBUFSIZE; i++) { - buf[i] = (char *)__get_free_pages(GFP_KERNEL, order); + buf[i] = (char *)__get_free_pages(GFP_KERNEL | __GFP_COMP, + order); if (!buf[i]) goto err_free_buf; }