From patchwork Wed Jan 10 12:11:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 124072 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5198790qgn; Wed, 10 Jan 2018 04:13:46 -0800 (PST) X-Google-Smtp-Source: ACJfBoumGGxyV9ifZngb0H/pAYNQX5QWHFZUqxjWu+5nngzoArWLsOISCwQCOF4NSwEruYR0zFy6 X-Received: by 10.98.149.21 with SMTP id p21mr7989206pfd.106.1515586426668; Wed, 10 Jan 2018 04:13:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515586426; cv=none; d=google.com; s=arc-20160816; b=OLGNGTnVnx1buydWmo9bVMznJI2h3QTpRDVdvKgY2Kk6W2tgbB9QMu+/jg4LE80LoI vKZXBPKJOdCjLFy3Jc10rNvkvEueSUS2xGtoAvwOLwEoa3zoaZaIknPHHDhwNGf6L7sp Z3diveCrQTBogELXgU/dRikddACYNHX7TGBi5MVNVse0C3GW3a8qvBMH77YutaFRY41/ 763tSD9eN8cjF4aMUDvuDG25tMzHvqO6uw+7oTylVSmVbFHGFUbxF2RiQlhXhGL8ZgL6 hiQPetPx725rBawE7EY2O+CznTNSVbTKYJFIhytrRbwtUH9JuuEVcSuZTy5Lz0tXH2KL dPEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=jy6ao3pZDP9091Xn0CmB5jzF5yI6zZxoY/Ei+etDSXM=; b=WpU0ElUkbgjgfmwpvQ1879zBYz3ZRmThN0h4Nw9+2Q4ZQTbz06z5w2LAS5tt8zn2Ue IIC2Zv+6kmm39KNc2isCywvZvnqNxxlmkBtwRxFoNBGKr+tgExi6M2J6489CNVFulXsQ JN7XlBVxI9iiDtsxyadCO41H6Mmll6IvKroKF4l0Ma9ETr/a8VGDcxt9rx4S/oKKmP9N nhflu0p2emJokZ8pnrMB0Ng7ijzgQH5AnnvYU8M950mdz7LbhZPW+fqm1zsgiE1AVTDc YDBOQuDP2uuSodrafM1gULBQZEvbGTxR0eCwPSbvCL5yOtC4SZMRv7MebWy5Sg8TobA8 bYwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WachCkD4; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si1022882plb.319.2018.01.10.04.13.46; Wed, 10 Jan 2018 04:13:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@linaro.org header.s=google header.b=WachCkD4; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964996AbeAJMNo (ORCPT + 1 other); Wed, 10 Jan 2018 07:13:44 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:46136 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964968AbeAJMNl (ORCPT ); Wed, 10 Jan 2018 07:13:41 -0500 Received: by mail-wm0-f68.google.com with SMTP id 143so1570643wma.5 for ; Wed, 10 Jan 2018 04:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jy6ao3pZDP9091Xn0CmB5jzF5yI6zZxoY/Ei+etDSXM=; b=WachCkD4Oh+qCVG7Mn9+8JuFWSyUtNB/g8p05FLvG4Pr9FxpEYNwNxXFzXXZLHNAgo L1Ggvfko0e6LT1ga4911r4tYoEwcHU/9Sm042GD3ObGb2+ht9RPMN/xW7S7NpIgpdkg2 bDtFY27/naenrG6MaRZ2s+aHcwMkwN9qmX29o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jy6ao3pZDP9091Xn0CmB5jzF5yI6zZxoY/Ei+etDSXM=; b=Eg1+QWdnSScLLty4o+3eRfh4a/jMkNlqs/wfp5C+l6vseAh6iF87SRF9RAqKu8kgy3 FzaGrt9GtfNrrIsCpR+q0SmMyzFJf5Q7YDpOrsPkHe3eYYLt4rgU2N7MPCFLLyFEXoiK WX2fc9g6t6rJwN6dtD1bByktUMDJLj+OPgSVPd0IEI+HE43VUAh4EeAQwbDBf7DeP1VM 0S1fzARU8VoanR5X+jjz39behoKX1HCaDAZOaM3vMMvYJwu+Mpj4dESfaCNNQQ4zDU79 40HtQByvPivYuHty9yP97eHTyd3BpZ42yx2qRMkrVEWJIS4Myf9a7gJwid/tu4P2+Dl3 8Dbw== X-Gm-Message-State: AKwxytd0c4NVov75hWcYyt2mFvHEjEU/bgzyswI6/K/zs4BpIwPe2mif 2639kh7GUdves/fvOp8a++l3vA== X-Received: by 10.28.1.210 with SMTP id 201mr836848wmb.120.1515586420577; Wed, 10 Jan 2018 04:13:40 -0800 (PST) Received: from localhost.localdomain ([154.144.231.40]) by smtp.gmail.com with ESMTPSA id l72sm1261615wmi.4.2018.01.10.04.13.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 04:13:39 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, will.deacon@arm.com, catalin.marinas@arm.com, marc.zyngier@arm.com, mark.rutland@arm.com, dann.frazier@canonical.com, steve.capper@linaro.org, Ard Biesheuvel Subject: [PATCH 4/7] arm64/crypto: crc32: move literal data to .rodata section Date: Wed, 10 Jan 2018 12:11:39 +0000 Message-Id: <20180110121142.18291-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180110121142.18291-1-ard.biesheuvel@linaro.org> References: <20180110121142.18291-1-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Move CRC32 literal data to the .rodata section where it is safe from being exploited by speculative execution. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/crc32-ce-core.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/arch/arm64/crypto/crc32-ce-core.S b/arch/arm64/crypto/crc32-ce-core.S index 18f5a8442276..16ed3c7ebd37 100644 --- a/arch/arm64/crypto/crc32-ce-core.S +++ b/arch/arm64/crypto/crc32-ce-core.S @@ -50,7 +50,7 @@ #include #include - .text + .section ".rodata", "a" .align 6 .cpu generic+crypto+crc @@ -115,12 +115,13 @@ * uint crc32_pmull_le(unsigned char const *buffer, * size_t len, uint crc32) */ + .text ENTRY(crc32_pmull_le) - adr x3, .Lcrc32_constants + adr_l x3, .Lcrc32_constants b 0f ENTRY(crc32c_pmull_le) - adr x3, .Lcrc32c_constants + adr_l x3, .Lcrc32c_constants 0: bic LEN, LEN, #15 ld1 {v1.16b-v4.16b}, [BUF], #0x40