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 0EB4826F44C for ; Sat, 4 Oct 2025 15:19:38 +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=1759591178; cv=none; b=ckoaMkgygsp0ATgaZenlSosm8/1zOPn4rCVSv70uDqulEmhDZcrKN80MLtqUVI0X9RNoY16+fyLSIDlM8DZ89l2OoRxM0WB33ynUWqIk1G36TsoLuN/Y2TwIYfINaJTrLu6XEViHn5GWYwXeJL6KHXDUPt5KxvNhU/enXMr/r8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759591178; c=relaxed/simple; bh=zC8h++QNF4us5N7qKrruOKWdpoUJBAdss++8Hr/a3HU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ECExEj0BKH2Xl46BSBymrhZosLqWXKoDuindEkp/Yv5WnN3LjKJwTcShoteTMnSJes+P81JDQdGhNOkPvwK9yLoOOT4RhFqbkLuNKczB5ItReG9Uwlm7HfuraS4+knfC07ok04PEdo0+0n3mKFORylRJaYNZc6/9b68EWo/8Grc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fTNapgD5; 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="fTNapgD5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B22BC4CEF1; Sat, 4 Oct 2025 15:19:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759591177; bh=zC8h++QNF4us5N7qKrruOKWdpoUJBAdss++8Hr/a3HU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=fTNapgD5pH7ILAWv8Ua30Fzcp7h8VkEVRbCtv6Fx2EQ5KAGuccH+NtOweOS09kPZ4 GyyxHPfUqJv8kk9ItaImkPFMA6IcMKk/bOgKa0SS/GngzVTsERJuaIshk2wnM+7vop 0NDEE3QbsRY5b0hZitAksON8lR0oqtsqI5J/Eqgk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53577: bpf, cpumap: Make sure kthread is running before map update returns Date: Sat, 4 Oct 2025 17:17:31 +0200 Message-ID: <2025100455-CVE-2023-53577-96e9@gregkh> X-Mailer: git-send-email 2.51.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=3888; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=77VMKJkHMC9oZ1OE4x134rfkUYe0xElNHr5LD7QtwwE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkPrdILt/jMUg6KfK464WJd1oug+I4SIfddfUueKjAZf PR68E2zI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZS/YhhwcnX0Y6tixitlvjy 6z99tnr3fYHnDxgWTPFNjv0pEr/goYjF+5Tt1/4qr9vaDgA= 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: bpf, cpumap: Make sure kthread is running before map update returns The following warning was reported when running stress-mode enabled xdp_redirect_cpu with some RT threads: ------------[ cut here ]------------ WARNING: CPU: 4 PID: 65 at kernel/bpf/cpumap.c:135 CPU: 4 PID: 65 Comm: kworker/4:1 Not tainted 6.5.0-rc2+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Workqueue: events cpu_map_kthread_stop RIP: 0010:put_cpu_map_entry+0xda/0x220 ...... Call Trace: ? show_regs+0x65/0x70 ? __warn+0xa5/0x240 ...... ? put_cpu_map_entry+0xda/0x220 cpu_map_kthread_stop+0x41/0x60 process_one_work+0x6b0/0xb80 worker_thread+0x96/0x720 kthread+0x1a5/0x1f0 ret_from_fork+0x3a/0x70 ret_from_fork_asm+0x1b/0x30 The root cause is the same as commit 436901649731 ("bpf: cpumap: Fix memory leak in cpu_map_update_elem"). The kthread is stopped prematurely by kthread_stop() in cpu_map_kthread_stop(), and kthread() doesn't call cpu_map_kthread_run() at all but XDP program has already queued some frames or skbs into ptr_ring. So when __cpu_map_ring_cleanup() checks the ptr_ring, it will find it was not emptied and report a warning. An alternative fix is to use __cpu_map_ring_cleanup() to drop these pending frames or skbs when kthread_stop() returns -EINTR, but it may confuse the user, because these frames or skbs have been handled correctly by XDP program. So instead of dropping these frames or skbs, just make sure the per-cpu kthread is running before __cpu_map_entry_alloc() returns. After apply the fix, the error handle for kthread_stop() will be unnecessary because it will always return 0, so just remove it. The Linux kernel CVE team has assigned CVE-2023-53577 to this issue. Affected and fixed versions =========================== Issue introduced in 4.15 with commit 6710e1126934d8b4372b4d2f9ae1646cd3f151bf and fixed in 5.15.126 with commit b44d28b98f185d2f2348aa3c3636838c316f889e Issue introduced in 4.15 with commit 6710e1126934d8b4372b4d2f9ae1646cd3f151bf and fixed in 6.1.45 with commit 7a1178a3671b40746830d355836b72e47ceb2490 Issue introduced in 4.15 with commit 6710e1126934d8b4372b4d2f9ae1646cd3f151bf and fixed in 6.4.10 with commit ecb45b852af5e88257020b88bea5ff0798d72aca Issue introduced in 4.15 with commit 6710e1126934d8b4372b4d2f9ae1646cd3f151bf and fixed in 6.5 with commit 640a604585aa30f93e39b17d4d6ba69fcb1e66c9 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-2023-53577 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: kernel/bpf/cpumap.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/b44d28b98f185d2f2348aa3c3636838c316f889e https://git.kernel.org/stable/c/7a1178a3671b40746830d355836b72e47ceb2490 https://git.kernel.org/stable/c/ecb45b852af5e88257020b88bea5ff0798d72aca https://git.kernel.org/stable/c/640a604585aa30f93e39b17d4d6ba69fcb1e66c9