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 DDE6B255F52 for ; Wed, 18 Jun 2025 11:15:11 +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=1750245311; cv=none; b=lP5xhf7P2v353GrJx4Px2OFMdVQcktNgSXBtlPvezJWcmNm0FAsdYr+HdC2o1boeVdgdl0VtunWOdR/Q3k6xhA986iKH21TajucKCFG6PX9mwprDyXBrMJzZ/Qn+rdedMzYypFSjZEF6Mqxe8nbxU8q6ZdEGXfnunpNRWBbhfNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245311; c=relaxed/simple; bh=ZGdafQ/7yUzu+Hh8DuapI4+KOVy4u4ywbuAldKDEyL4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oNUVqrazX2IMEzktFYnsBx12tUt9i25ek6e7FfCNiKnzseNo0wE9wH0xGUPEP4dil6RJWKmOUKiih2OSCasLifU2muEy9WkZbUv/D3672+OT3gxd4+t4/JgXhwGpHeMW7ks27s+HwOvZ31tT6lyU1Cb3/OGyWauBLGjuMJ/3UyE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K1kdEahn; 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="K1kdEahn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B698C4CEE7; Wed, 18 Jun 2025 11:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245311; bh=ZGdafQ/7yUzu+Hh8DuapI4+KOVy4u4ywbuAldKDEyL4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=K1kdEahnknFvxSSog0hXKUos8bN36uVbRNjYbtz+UxSsNi7kaB5f1pmmo6B730ULs KKNTSIdTAyLb13I4FIoEuwT5TISWTtp9YeAOoRj00TdPGiC1FpBLRHXwVuGTb9RkG1 Mgvy62YLBCGtjkfac4RNgnH1lRbbv9hAoZy1TGSk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50193: erofs: wake up all waiters after z_erofs_lzma_head ready Date: Wed, 18 Jun 2025 13:04:18 +0200 Message-ID: <2025061837-CVE-2022-50193-84a0@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=3331; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=6sujjk2B/0l/8mG1jdGIDDNEE3SKU+JYmJc9XAwk/k4=; b=kA0DAAIRMUfUDdst+ykByyZiAGhSnJGjbzGoHfbG/xNsxuOOpcObUJhRQsXx8C1L0CAqrXBSF IhdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmhSnJEACgkQMUfUDdst+ykImACgwkL5 zHDM6TYZc8PgFeKJF53fGJcAn2sXW8WjmLnALFOJzZwaJluakc98 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: erofs: wake up all waiters after z_erofs_lzma_head ready When the user mounts the erofs second times, the decompression thread may hung. The problem happens due to a sequence of steps like the following: 1) Task A called z_erofs_load_lzma_config which obtain all of the node from the z_erofs_lzma_head. 2) At this time, task B called the z_erofs_lzma_decompress and wanted to get a node. But the z_erofs_lzma_head was empty, the Task B had to sleep. 3) Task A release nodes and push nodes into the z_erofs_lzma_head. But task B was still sleeping. One example report when the hung happens: task:kworker/u3:1 state:D stack:14384 pid: 86 ppid: 2 flags:0x00004000 Workqueue: erofs_unzipd z_erofs_decompressqueue_work Call Trace: __schedule+0x281/0x760 schedule+0x49/0xb0 z_erofs_lzma_decompress+0x4bc/0x580 ? cpu_core_flags+0x10/0x10 z_erofs_decompress_pcluster+0x49b/0xba0 ? __update_load_avg_se+0x2b0/0x330 ? __update_load_avg_se+0x2b0/0x330 ? update_load_avg+0x5f/0x690 ? update_load_avg+0x5f/0x690 ? set_next_entity+0xbd/0x110 ? _raw_spin_unlock+0xd/0x20 z_erofs_decompress_queue.isra.0+0x2e/0x50 z_erofs_decompressqueue_work+0x30/0x60 process_one_work+0x1d3/0x3a0 worker_thread+0x45/0x3a0 ? process_one_work+0x3a0/0x3a0 kthread+0xe2/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 The Linux kernel CVE team has assigned CVE-2022-50193 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit 622ceaddb7649ca328832f50ba1400af778d75fa and fixed in 5.18.18 with commit 2478e36ec437a27f8a05bea9e4269a68c554e21f Issue introduced in 5.16 with commit 622ceaddb7649ca328832f50ba1400af778d75fa and fixed in 5.19.2 with commit 96aa2a6a89618d850ef082e4268007e840c28769 Issue introduced in 5.16 with commit 622ceaddb7649ca328832f50ba1400af778d75fa and fixed in 6.0 with commit 2df7c4bd7c1d2bc5ece5e9ed19dbd386810c2a65 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-50193 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: fs/erofs/decompressor_lzma.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/2478e36ec437a27f8a05bea9e4269a68c554e21f https://git.kernel.org/stable/c/96aa2a6a89618d850ef082e4268007e840c28769 https://git.kernel.org/stable/c/2df7c4bd7c1d2bc5ece5e9ed19dbd386810c2a65