Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6124355yba; Thu, 11 Apr 2019 12:33:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwn/GhlN/O0MHJr0BD08FYHWu7ouRm93cmgjqsLOJg/VwyiU7IQ7yyc08QFTXCL5uWQZcxc X-Received: by 2002:a17:902:681:: with SMTP id 1mr53097471plh.31.1555011220963; Thu, 11 Apr 2019 12:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555011220; cv=none; d=google.com; s=arc-20160816; b=CV0uLLjc5iwddXQN8EX0RIMo42/l9Me335tOfKjMCdhq6uEi1ZM7L8iGGszLVJjSQ0 onPKBdpSF0Ev3mb9u3m94M5yjzS+YatXtg/6P6zyPrLaFGfs5sDWCcyRugMeS4Dz9tol GMrT7qHz2n+DbeF59qCace2nT0/7vOeEO7bqtPt33Bph/OZx8QJ66NOFlVXfp/DQKQo9 A18d3uM1ODasT233ZU676mUfE6aGkJTq26uE929TWt5F+XR+jxxkfSIPNToDklvXv+Cy JH2BMP835Ypgir8nRnCl9qpB/bjc5a/khBURyVUR2LXbk6w4wbrGJIgxLsqK1PpPk3e5 Pvyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qB2oTxMFV+xwaAfzqu/e1QmB0fLVODHjtaItXxVEIrE=; b=jEtNgTysUia+kqGVBxzfaOs+7Xw+p3UuxxkikocyD/P8wbokuxDYPzXPK9W2pMTyEt wmHNnCrdyaDn8inH5XEKSv9c4Lg5WUHt/LGixytiuuRXi/09/9+9mIX0aYMspyjNOSOz 0bQ28bABwah48+GQP2QN1dlHiFMksQKeUrR9aPOcfhzgmZNafRdE3vvWFcHkDw5p+nFT rPdujPHG2UrFQPdxYfKgOZCJ7OX69Ct9gpR6jLNm0f5QgOhYa426l30K5PBH3CHyJnM6 rJvuBPVAU5FTm6OZWqkS3RFmI97YlcUNsmcaaqzav1WWuBT58yvxTVQrHtLe2phv+se3 tujA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pZIr1Qir; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si30616600pgg.478.2019.04.11.12.33.24; Thu, 11 Apr 2019 12:33:40 -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=pZIr1Qir; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726712AbfDKTbV (ORCPT + 99 others); Thu, 11 Apr 2019 15:31:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:44864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbfDKTbV (ORCPT ); Thu, 11 Apr 2019 15:31:21 -0400 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 Cc: Kees Cook , Dmitry Vyukov , Geert Uytterhoeven , linux-security-module , Linux ARM , Linux Kernel Mailing List , Laura Abbott , Rik van Riel 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } -- 2.21.0.392.gf8f6787159e-goog