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_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 91BEBC43381 for ; Wed, 20 Mar 2019 16:19:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62D0D2183E for ; Wed, 20 Mar 2019 16:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553098785; bh=a7Egds4lecnkEnZxKT/qUKlFqTsGHESH1Jm5geArTBk=; h=Subject:To:Cc:From:Date:List-ID:From; b=TNnC+QnC4y7i4/qTrJr/GrXO2l9nYdR4Zu04UHm6Canr3rUWkzIxLvI9mfV7bn+Kc plJU5B5LgzoJPlVIl0//5v9d0DRzg/QRtgSihaLeE6M7zH9WTPwC1WHK/VH5h37JaH E+YcRJP/Y+6aiWrCEZNpvs6KWbLQZFxFKRkye7Do= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726830AbfCTQTp (ORCPT ); Wed, 20 Mar 2019 12:19:45 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:58315 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbfCTQTo (ORCPT ); Wed, 20 Mar 2019 12:19:44 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 32BDA2225B; Wed, 20 Mar 2019 12:19:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 20 Mar 2019 12:19:43 -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=zj866i AaHG003D+MWkBsKjOgxR2IXaqUEkVEj7pnUEo=; b=IOas3eCJSDxRmLPPrjf872 6GVNGz+/1XCw+TtIoeWjPHrLvyhVEaoYbSdPu0xzoN2pIOk6Nct/7RjXLLszcSWF LeI1XM4nKRQW9Ytr3AmJ4vRNMAmc54V4fReVfaYRXvhOBVYex6vor0SQGAheutyV 1WGCct8+BUL55GIHbPb/+fTawIHga8YBjKDs3R1wBW5FQ/skIV8dlRHY2jtRO/Hq 68HodQOnAZ+jvaWg/+klN9QW2nY3c/2aYIrNLyI7bmORImxBb1V8aBw81kysu76Y GnpuZUZ4YIeCP2d4YCHaWmSWqF0nNnE00siCNk8WgaYKTA9gzCb8doP+AgE/dcbA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrieeigdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpeeg 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 76659E4807; Wed, 20 Mar 2019 12:19:42 -0400 (EDT) Subject: FAILED: patch "[PATCH] crypto: testmgr - skip crc32c context test for ahash" failed to apply to 4.9-stable tree To: ebiggers@google.com, herbert@gondor.apana.org.au Cc: From: Date: Wed, 20 Mar 2019 17:19:40 +0100 Message-ID: <155309878015749@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.9-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 eb5e6730db98fcc4b51148b4a819fa4bf864ae54 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 23 Jan 2019 20:57:35 -0800 Subject: [PATCH] crypto: testmgr - skip crc32c context test for ahash algorithms Instantiating "cryptd(crc32c)" causes a crypto self-test failure because the crypto_alloc_shash() in alg_test_crc32c() fails. This is because cryptd(crc32c) is an ahash algorithm, not a shash algorithm; so it can only be accessed through the ahash API, unlike shash algorithms which can be accessed through both the ahash and shash APIs. As the test is testing the shash descriptor format which is only applicable to shash algorithms, skip it for ahash algorithms. (Note that it's still important to fix crypto self-test failures even for weird algorithm instantiations like cryptd(crc32c) that no one would really use; in fips_enabled mode unprivileged users can use them to panic the kernel, and also they prevent treating a crypto self-test failure as a bug when fuzzing the kernel.) Fixes: 8e3ee85e68c5 ("crypto: crc32c - Test descriptor context format") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 4ac3d22256c3..a73455b543ad 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -1909,14 +1909,21 @@ static int alg_test_crc32c(const struct alg_test_desc *desc, err = alg_test_hash(desc, driver, type, mask); if (err) - goto out; + return err; tfm = crypto_alloc_shash(driver, type, mask); if (IS_ERR(tfm)) { + if (PTR_ERR(tfm) == -ENOENT) { + /* + * This crc32c implementation is only available through + * ahash API, not the shash API, so the remaining part + * of the test is not applicable to it. + */ + return 0; + } printk(KERN_ERR "alg: crc32c: Failed to load transform for %s: " "%ld\n", driver, PTR_ERR(tfm)); - err = PTR_ERR(tfm); - goto out; + return PTR_ERR(tfm); } do { @@ -1943,7 +1950,6 @@ static int alg_test_crc32c(const struct alg_test_desc *desc, crypto_free_shash(tfm); -out: return err; }