Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76FF91C8FBA for ; Wed, 18 Jun 2025 11:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245328; cv=none; b=KHKI9gflCbxCaZuViTmqMuHMJNTc6qCxqKGWSLn39fB8mX7V9NUmiV/27Qfz9AO9edUJqKngwF4ssZ3yMevBl6/YZHHuR0G5rD9dHf4Lq9Hz128KsJ6/3YMUmBS4frIjhYVK01y9MrP/XvfmpUGxuI5tqPnaMeN5oXt8jm4WgB0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245328; c=relaxed/simple; bh=GrQfJDNLB1deS0/IJZsXQQQTEzVCVJvlztaEzFBJ5E8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PcxJe47ax/pb9+Tr+qPqVQ314Ah7xTAxZsw4ZKkmnxyr7fvAX6QV1iqJZCxN18UYB5fmEpf9T2JyiYDkbt+na7KvI8+OLdVZ8o8V7haCOFfqaWOb/wLMTryYnoidOT8u9IMv0B7DTnzD06q+zA/LdZkQCZmPsPhAQdMoEz4I+WA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=03Zm6JPn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="03Zm6JPn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E562CC4CEE7; Wed, 18 Jun 2025 11:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245328; bh=GrQfJDNLB1deS0/IJZsXQQQTEzVCVJvlztaEzFBJ5E8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=03Zm6JPni9bkledhFJ+rzdVnG97NbpmxtPICa55bW1/+FJGHADQvV1PGPfq3EO5j4 4+7IQVElMxxBygeB8lcKpMB4U0t7d9f6Rl41mEpTO2/ub3kxjQUJYjtqke7iW3XCa4 k2CnPY5ZbOZzsDWMPn5Cds/SfTlaXb8pTyXJpewo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50171: crypto: hisilicon/sec - don't sleep when in softirq Date: Wed, 18 Jun 2025 13:03:56 +0200 Message-ID: <2025061829-CVE-2022-50171-733e@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4648; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Y+aRAsmgVS6SuUyK3OV+0B34bnd/J5conQloj/9ssEQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBczonbfuZ9ep0/LM2cbnlDjW35noYFM5Ic2XJSDIzW p3p+OBqRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEyE/TXDfM8t96wv1Z51nnrc 8tFGG73KS9feBjLMT1lb8O9a5Mozv2/r7Ji3a8lDW2d2PwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: crypto: hisilicon/sec - don't sleep when in softirq When kunpeng920 encryption driver is used to deencrypt and decrypt packets during the softirq, it is not allowed to use mutex lock. The kernel will report the following error: BUG: scheduling while atomic: swapper/57/0/0x00000300 Call trace: dump_backtrace+0x0/0x1e4 show_stack+0x20/0x2c dump_stack+0xd8/0x140 __schedule_bug+0x68/0x80 __schedule+0x728/0x840 schedule+0x50/0xe0 schedule_preempt_disabled+0x18/0x24 __mutex_lock.constprop.0+0x594/0x5dc __mutex_lock_slowpath+0x1c/0x30 mutex_lock+0x50/0x60 sec_request_init+0x8c/0x1a0 [hisi_sec2] sec_process+0x28/0x1ac [hisi_sec2] sec_skcipher_crypto+0xf4/0x1d4 [hisi_sec2] sec_skcipher_encrypt+0x1c/0x30 [hisi_sec2] crypto_skcipher_encrypt+0x2c/0x40 crypto_authenc_encrypt+0xc8/0xfc [authenc] crypto_aead_encrypt+0x2c/0x40 echainiv_encrypt+0x144/0x1a0 [echainiv] crypto_aead_encrypt+0x2c/0x40 esp_output_tail+0x348/0x5c0 [esp4] esp_output+0x120/0x19c [esp4] xfrm_output_one+0x25c/0x4d4 xfrm_output_resume+0x6c/0x1fc xfrm_output+0xac/0x3c0 xfrm4_output+0x64/0x130 ip_build_and_send_pkt+0x158/0x20c tcp_v4_send_synack+0xdc/0x1f0 tcp_conn_request+0x7d0/0x994 tcp_v4_conn_request+0x58/0x6c tcp_v6_conn_request+0xf0/0x100 tcp_rcv_state_process+0x1cc/0xd60 tcp_v4_do_rcv+0x10c/0x250 tcp_v4_rcv+0xfc4/0x10a4 ip_protocol_deliver_rcu+0xf4/0x200 ip_local_deliver_finish+0x58/0x70 ip_local_deliver+0x68/0x120 ip_sublist_rcv_finish+0x70/0x94 ip_list_rcv_finish.constprop.0+0x17c/0x1d0 ip_sublist_rcv+0x40/0xb0 ip_list_rcv+0x140/0x1dc __netif_receive_skb_list_core+0x154/0x28c __netif_receive_skb_list+0x120/0x1a0 netif_receive_skb_list_internal+0xe4/0x1f0 napi_complete_done+0x70/0x1f0 gro_cell_poll+0x9c/0xb0 napi_poll+0xcc/0x264 net_rx_action+0xd4/0x21c __do_softirq+0x130/0x358 irq_exit+0x11c/0x13c __handle_domain_irq+0x88/0xf0 gic_handle_irq+0x78/0x2c0 el1_irq+0xb8/0x140 arch_cpu_idle+0x18/0x40 default_idle_call+0x5c/0x1c0 cpuidle_idle_call+0x174/0x1b0 do_idle+0xc8/0x160 cpu_startup_entry+0x30/0x11c secondary_start_kernel+0x158/0x1e4 softirq: huh, entered softirq 3 NET_RX 0000000093774ee4 with preempt_count 00000100, exited with fffffe00? The Linux kernel CVE team has assigned CVE-2022-50171 to this issue. Affected and fixed versions =========================== Issue introduced in 5.5 with commit 416d82204df44ef727de6eafafeaa4d12fdc78dc and fixed in 5.10.137 with commit 16e18a8ac7c9748cf35a8d2f0ba2c6e8850e7568 Issue introduced in 5.5 with commit 416d82204df44ef727de6eafafeaa4d12fdc78dc and fixed in 5.15.61 with commit aa495dfe71229b9034b59d8072ff0b2325ddd5ee Issue introduced in 5.5 with commit 416d82204df44ef727de6eafafeaa4d12fdc78dc and fixed in 5.18.18 with commit 4a461ba5b9753352f438824fdd915cba675b1733 Issue introduced in 5.5 with commit 416d82204df44ef727de6eafafeaa4d12fdc78dc and fixed in 5.19.2 with commit c9be45e4c69fde36522274f04d1aa0d097ae3958 Issue introduced in 5.5 with commit 416d82204df44ef727de6eafafeaa4d12fdc78dc and fixed in 6.0 with commit 02884a4f12de11f54d4ca67a07dd1f111d96fdbd Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50171 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/crypto/hisilicon/sec2/sec.h drivers/crypto/hisilicon/sec2/sec_crypto.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/16e18a8ac7c9748cf35a8d2f0ba2c6e8850e7568 https://git.kernel.org/stable/c/aa495dfe71229b9034b59d8072ff0b2325ddd5ee https://git.kernel.org/stable/c/4a461ba5b9753352f438824fdd915cba675b1733 https://git.kernel.org/stable/c/c9be45e4c69fde36522274f04d1aa0d097ae3958 https://git.kernel.org/stable/c/02884a4f12de11f54d4ca67a07dd1f111d96fdbd