Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5FCFC43381 for ; Wed, 20 Mar 2019 16:20:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A30382183E for ; Wed, 20 Mar 2019 16:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553098838; bh=FqO9hw747n8A3fL6xdMhzT4ilaYanqM5yN8Qpk3vS8E=; h=Subject:To:Cc:From:Date:List-ID:From; b=1NHTjshSkdibJ5f68hGZwulaHNoIXsWJnX+Qdm3mwOVrV+KgFZO6fCKswV/CYJsDX 9gg+EjyktB66fvQ0XajzUwWWm48NqYiqY+GFEz41e1yaeTjUXTEYQ2hwqeibBoE/jX Pd9Qk+LKvnRUBDjENOMX2GOpW9KhsorbtwuSyH9w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727330AbfCTQUi (ORCPT ); Wed, 20 Mar 2019 12:20:38 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:51687 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727205AbfCTQUi (ORCPT ); Wed, 20 Mar 2019 12:20:38 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id BF8A92314F; Wed, 20 Mar 2019 12:20:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 20 Mar 2019 12:20:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=KWigRe Zw74OASVIapRxPwlFkjAh30a6L3gbnY4iivGY=; b=bXhopvLz9yWiYlBZwN3QG0 NeJNt8a9eoUbh22YQsVAUbtQOMNwzO0qdHrjNRUrNprW9x+9YAmcDJM/QvAMt0gv X4d/ybZN/VQ5WY4ZjRuYe7DnhzncwaEndpRIGkDkNDUoSQfsiFP3mz+QDUjRMnOE kTes5Bw48+LqxicTukDTmDVYImZUMO88+psndVmgV/a+L8sfgZf3/v6OiB6Jr8Z8 CnoibX9/VKJcTVQxbq1ktiv6urtAfiHWrOHOfs+8+UdRwo8N9+rlZsKCaK2HI/+8 y6Lh7OKGn2S/qUdSkkOeGDuXQUQnwVu8sJFJ3PfXjk/iFpJn33awwNvckDFi/k8g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrieeigdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucffohhmrghinheprggvshdqtggvqdgttghmqdgtohhrvgdrshgsnecukfhppeekfe drkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhho rghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id BEC98E4519; Wed, 20 Mar 2019 12:20:35 -0400 (EDT) Subject: FAILED: patch "[PATCH] crypto: arm64/aes-ccm - fix logical bug in AAD MAC handling" failed to apply to 3.18-stable tree To: ard.biesheuvel@linaro.org, ebiggers@kernel.org, herbert@gondor.apana.org.au Cc: From: Date: Wed, 20 Mar 2019 17:20:34 +0100 Message-ID: <155309883423993@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 3.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From eaf46edf6ea89675bd36245369c8de5063a0272c Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Thu, 24 Jan 2019 17:33:45 +0100 Subject: [PATCH] crypto: arm64/aes-ccm - fix logical bug in AAD MAC handling The NEON MAC calculation routine fails to handle the case correctly where there is some data in the buffer, and the input fills it up exactly. In this case, we enter the loop at the end with w8 == 0, while a negative value is assumed, and so the loop carries on until the increment of the 32-bit counter wraps around, which is quite obviously wrong. So omit the loop altogether in this case, and exit right away. Reported-by: Eric Biggers Fixes: a3fd82105b9d1 ("arm64/crypto: AES in CCM mode using ARMv8 Crypto ...") Cc: stable@vger.kernel.org Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu diff --git a/arch/arm64/crypto/aes-ce-ccm-core.S b/arch/arm64/crypto/aes-ce-ccm-core.S index e3a375c4cb83..1b151442dac1 100644 --- a/arch/arm64/crypto/aes-ce-ccm-core.S +++ b/arch/arm64/crypto/aes-ce-ccm-core.S @@ -74,12 +74,13 @@ ENTRY(ce_aes_ccm_auth_data) beq 10f ext v0.16b, v0.16b, v0.16b, #1 /* rotate out the mac bytes */ b 7b -8: mov w7, w8 +8: cbz w8, 91f + mov w7, w8 add w8, w8, #16 9: ext v1.16b, v1.16b, v1.16b, #1 adds w7, w7, #1 bne 9b - eor v0.16b, v0.16b, v1.16b +91: eor v0.16b, v0.16b, v1.16b st1 {v0.16b}, [x0] 10: str w8, [x3] ret