From mboxrd@z Thu Jan 1 00:00:00 1970 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_HELO_NONE,SPF_PASS 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 2BCF2C04E84 for ; Fri, 17 May 2019 12:39:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F39F32087E for ; Fri, 17 May 2019 12:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558096791; bh=UzPn7a27ZHErmxdMqRINh/0Z4Br1f8B3xEisuLTFyDE=; h=Subject:To:Cc:From:Date:List-ID:From; b=mHy/93EaHl8D8DDDuYL0K0rC0HYm/yRYIzT+Knn5vhs70bIOdBqQKcGLpLhasjxts jejm2KcvhvKUNj3XZfyGsIXdxA6BvrxgnXChEfM9iOCqux4Y/Lz+ObN5yaB/MydfIf pl6p9c6fMOlduwDu5iHbr/W81flcwl75GQ4ugFy8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728169AbfEQMju (ORCPT ); Fri, 17 May 2019 08:39:50 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:43215 "EHLO wout3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728990AbfEQMjt (ORCPT ); Fri, 17 May 2019 08:39:49 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id C1B6244A; Fri, 17 May 2019 08:39:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 17 May 2019 08:39:49 -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=wKv1xk oLrQsDqfTaFyQUwSjD25sGAS4IvsuURgTZDrU=; b=dO4Ek6+UCd2TloqmTjHy4V t78YaR4lJgLov4/kBqs9t+9pPtTNgpE7LDuihLqUW3pxeZ2sYpZXHPMkzBTax+Tm CLpy6YYE8lysCWu0TfBP+BCHdEKtZ7O60/yE6OH6LR9vavmwLM0XJEA+0jvFpQgb Td/IZUxANWO4VBhV1LwQlU+fHT/S/RjZwkqszfATF+gHEfeaxCJ+k8eDWPa44W+p lRvcvhLixo1cwNXceNmdSD0HfyEwsxDbnN5hkD/zShSeQ+k+ZK+pftLjmQ8g4be2 Kxku22dbZuT4QAzgqYCLPq/PoN5qtObYT+fzD5bzRl9jBbJBHMOWhId4XyDFCCDA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtvddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomh epghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgephe X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id D12F48005B; Fri, 17 May 2019 08:39:47 -0400 (EDT) Subject: FAILED: patch "[PATCH] crypto: arm64/aes-neonbs - don't access already-freed walk.iv" failed to apply to 4.14-stable tree To: ebiggers@google.com, herbert@gondor.apana.org.au, stable@vger.kernel.org Cc: From: Date: Fri, 17 May 2019 14:39:46 +0200 Message-ID: <1558096786211204@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 4.14-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 4a8108b70508df0b6c4ffa4a3974dab93dcbe851 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 9 Apr 2019 23:46:32 -0700 Subject: [PATCH] crypto: arm64/aes-neonbs - don't access already-freed walk.iv If the user-provided IV needs to be aligned to the algorithm's alignmask, then skcipher_walk_virt() copies the IV into a new aligned buffer walk.iv. But skcipher_walk_virt() can fail afterwards, and then if the caller unconditionally accesses walk.iv, it's a use-after-free. xts-aes-neonbs doesn't set an alignmask, so currently it isn't affected by this despite unconditionally accessing walk.iv. However this is more subtle than desired, and unconditionally accessing walk.iv has caused a real problem in other algorithms. Thus, update xts-aes-neonbs to start checking the return value of skcipher_walk_virt(). Fixes: 1abee99eafab ("crypto: arm64/aes - reimplement bit-sliced ARM/NEON implementation for arm64") Cc: # v4.11+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu diff --git a/arch/arm64/crypto/aes-neonbs-glue.c b/arch/arm64/crypto/aes-neonbs-glue.c index 4737b6c6c5cf..514455117733 100644 --- a/arch/arm64/crypto/aes-neonbs-glue.c +++ b/arch/arm64/crypto/aes-neonbs-glue.c @@ -304,6 +304,8 @@ static int __xts_crypt(struct skcipher_request *req, int err; err = skcipher_walk_virt(&walk, req, false); + if (err) + return err; kernel_neon_begin(); neon_aes_ecb_encrypt(walk.iv, walk.iv, ctx->twkey, ctx->key.rounds, 1);