From patchwork Thu Oct 18 04:37:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10646695 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 9224B14E2 for ; Thu, 18 Oct 2018 04:39:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8422728A02 for ; Thu, 18 Oct 2018 04:39:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77CB128A12; Thu, 18 Oct 2018 04:39:45 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F30428A02 for ; Thu, 18 Oct 2018 04:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727338AbeJRMiq (ORCPT ); Thu, 18 Oct 2018 08:38:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:57304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727297AbeJRMiq (ORCPT ); Thu, 18 Oct 2018 08:38:46 -0400 Received: from sol.hsd1.wa.comcast.net (c-67-185-97-198.hsd1.wa.comcast.net [67.185.97.198]) (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 CCA0F2145D; Thu, 18 Oct 2018 04:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539837583; bh=u9smXc6rK0WUNcWQZUMtAwKGZTRbGwRMTrufKUWrrs8=; h=From:To:Cc:Subject:Date:From; b=YgjnTjWrzNYiXElo2agGRQfOxFHkc1MbnUuUourF8etGHhquM1+eNeJy8VC0Sm1fQ +BlSDA4af2NyNz2ONn/ETvFuiM0GVpQk/yxwBKDv/MeQNXjScWxkFN8B6trijJNBPV bjrF8x1q4gWNaBsBZTdu7tcVi1GXJtqszdPakdu8= From: Eric Biggers To: linux-crypto@vger.kernel.org, Herbert Xu Cc: Ard Biesheuvel , Paul Crowley Subject: [PATCH v3 0/2] crypto: some hardening against AES cache-timing attacks Date: Wed, 17 Oct 2018 21:37:57 -0700 Message-Id: <20181018043759.7669-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series makes the "aes-fixed-time" and "aes-arm" implementations of AES more resistant to cache-timing attacks. Note that even after these changes, the implementations still aren't necessarily guaranteed to be constant-time; see https://cr.yp.to/antiforgery/cachetiming-20050414.pdf for a discussion of the many difficulties involved in writing truly constant-time AES software. But it's valuable to make such attacks more difficult. Changed since v2: - In aes-arm, move the IRQ disable/enable into the assembly file. - Other aes-arm tweaks. - Add Kconfig help text. Thanks to Ard Biesheuvel for the suggestions. Eric Biggers (2): crypto: aes_ti - disable interrupts while accessing S-box crypto: arm/aes - add some hardening against cache-timing attacks arch/arm/crypto/Kconfig | 9 +++++ arch/arm/crypto/aes-cipher-core.S | 62 ++++++++++++++++++++++++++----- crypto/Kconfig | 3 +- crypto/aes_generic.c | 9 +++-- crypto/aes_ti.c | 18 +++++++++ 5 files changed, 86 insertions(+), 15 deletions(-)