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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77872C433F5 for ; Sun, 23 Jan 2022 16:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:From:Cc:To :Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4jetuku+pnSBpCSnMWAt4ahDX0ZFt9bXW63fbQP5x6o=; b=SLdHgcIdpFFlBi jCcse2/65L243SemdcBnGguL/0vtrucNoaJ/Be3F+6tUrSSqVbC7Y4dfMbOQ3sqQwBC4PooDzaPiC CoTENfWS/ubTJfyaxYkeZ2kd2zNTDXvlUXHVQQo2sqfi1MSoOcty/+9BqUWrzFEdqvjz+VtbWUgRi nRTbsXOs9Ffn5NQPGLixOr3wOZLu9vdIGUimWQbcZLnOizo2G82WMfxUDaoKarRO4ktkB7IYIQ5sa OAglPH5Ylm9X2L4bdFQ1G4cfUOcwH9hHWnm9dBCiq+ut7u3B2lrLrnMOtrVz8rXkZxK1Er73bWkXs Y6lorZaatUbVJ5GqkNJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBfWm-001JH4-6z; Sun, 23 Jan 2022 16:15:40 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBfWh-001JFf-WC for linux-arm-kernel@lists.infradead.org; Sun, 23 Jan 2022 16:15:37 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9342F60F64; Sun, 23 Jan 2022 16:15:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50A22C340E5; Sun, 23 Jan 2022 16:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1642954535; bh=NzsYGgS3g5CUenCi7UxddjNFpfaeMQvPdv0CBJzGOZM=; h=Subject:To:Cc:From:Date:From; b=mxIaD2+c+ftARicseTJ1IGY2ksQ8UgxNNoTsWObXr7reA1nNbclNB4QyzZX5XYrPm yrJqFUWydAXcmjz2aQa0P9tzi3XeF0hJwX7ARKm5t25IzaMoJt1rnIrL3x7i28v0fP MbyIIKWFRMHIDkaqjeGH1cWnEzagNSQ72vpNWSzo= Subject: Patch "crypto: stm32/crc32 - Fix kernel BUG triggered in probe()" has been added to the 5.15-stable tree To: alexandre.torgue@foss.st.com, fabien.dessenne@st.com, gregkh@linuxfoundation.org, herbert@gondor.apana.org.au, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, lionel.debieve@st.com, marex@denx.de, nicolas.toromanoff@foss.st.com, nicolas.toromanoff@st.com Cc: From: Date: Sun, 23 Jan 2022 17:14:43 +0100 Message-ID: <164295448335135@kroah.com> MIME-Version: 1.0 X-stable: commit X-Patchwork-Hint: ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220123_081536_152624_1C350B1E X-CRM114-Status: GOOD ( 18.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a note to let you know that I've just added the patch titled crypto: stm32/crc32 - Fix kernel BUG triggered in probe() to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: crypto-stm32-crc32-fix-kernel-bug-triggered-in-probe.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From 29009604ad4e3ef784fd9b9fef6f23610ddf633d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 20 Dec 2021 20:50:22 +0100 Subject: crypto: stm32/crc32 - Fix kernel BUG triggered in probe() From: Marek Vasut commit 29009604ad4e3ef784fd9b9fef6f23610ddf633d upstream. The include/linux/crypto.h struct crypto_alg field cra_driver_name description states "Unique name of the transformation provider. " ... " this contains the name of the chip or provider and the name of the transformation algorithm." In case of the stm32-crc driver, field cra_driver_name is identical for all registered transformation providers and set to the name of the driver itself, which is incorrect. This patch fixes it by assigning a unique cra_driver_name to each registered transformation provider. The kernel crash is triggered when the driver calls crypto_register_shashes() which calls crypto_register_shash(), which calls crypto_register_alg(), which calls __crypto_register_alg(), which returns -EEXIST, which is propagated back through this call chain. Upon -EEXIST from crypto_register_shash(), the crypto_register_shashes() starts unregistering the providers back, and calls crypto_unregister_shash(), which calls crypto_unregister_alg(), and this is where the BUG() triggers due to incorrect cra_refcnt. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Marek Vasut Cc: # 4.12+ Cc: Alexandre Torgue Cc: Fabien Dessenne Cc: Herbert Xu Cc: Lionel Debieve Cc: Nicolas Toromanoff Cc: linux-arm-kernel@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-crypto@vger.kernel.org Acked-by: Nicolas Toromanoff Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/stm32/stm32-crc32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/crypto/stm32/stm32-crc32.c +++ b/drivers/crypto/stm32/stm32-crc32.c @@ -279,7 +279,7 @@ static struct shash_alg algs[] = { .digestsize = CHKSUM_DIGEST_SIZE, .base = { .cra_name = "crc32", - .cra_driver_name = DRIVER_NAME, + .cra_driver_name = "stm32-crc32-crc32", .cra_priority = 200, .cra_flags = CRYPTO_ALG_OPTIONAL_KEY, .cra_blocksize = CHKSUM_BLOCK_SIZE, @@ -301,7 +301,7 @@ static struct shash_alg algs[] = { .digestsize = CHKSUM_DIGEST_SIZE, .base = { .cra_name = "crc32c", - .cra_driver_name = DRIVER_NAME, + .cra_driver_name = "stm32-crc32-crc32c", .cra_priority = 200, .cra_flags = CRYPTO_ALG_OPTIONAL_KEY, .cra_blocksize = CHKSUM_BLOCK_SIZE, Patches currently in stable-queue which might be from marex@denx.de are queue-5.15/soc-imx-gpcv2-synchronously-suspend-mix-domains.patch queue-5.15/crypto-stm32-cryp-fix-double-pm-exit.patch queue-5.15/crypto-stm32-cryp-fix-bugs-and-crash-in-tests.patch queue-5.15/crypto-stm32-crc32-fix-kernel-bug-triggered-in-probe.patch _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel