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 986D215E5DC for ; Tue, 9 Dec 2025 00:03:36 +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=1765238616; cv=none; b=exRTSw/4cBEU117pJCcFYwMi+oYULYYuKeevxPhRTaoCGslzTF+ZLFR9h0J9Dhh9HSLwnWzTX6peUthCiKPeAgBbw5vumoXLE81JtlhXm67ddsp+u/OiQYrIV2he/GtHaZoWvwp2AMnprX+rDXvMQu+gX5f+ww5aWrJz0+nTyVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765238616; c=relaxed/simple; bh=VRbJ2MbY8xqQDHgedZZAIJtN+K7nAA+OCHJl7tS+Gs4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d0Q5Odj65UabNF3zsgM3b1BANH66ErsMm+r3L77UK3ANsgM9zwExGbvB8GcOEyiQw144OsQdcAOvYgx5Y5ZVO6ujkVy/d2UiEZxf1iy3FeQMkNaiEdWvlEvvokiux8OqrIHexifQfkFgdgIU/GNeUtTHEkVS9WUi4y4xnbm1Knw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YxG7yfvR; 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="YxG7yfvR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38284C4CEF1; Tue, 9 Dec 2025 00:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765238616; bh=VRbJ2MbY8xqQDHgedZZAIJtN+K7nAA+OCHJl7tS+Gs4=; h=From:To:Cc:Subject:Date:Reply-To:From; b=YxG7yfvR58Xlra0aEoDSv3qhv98/ZhO8Bjd5JTisV2D4I409m9uXuChvv+fX50Xsw ZVI9NYH4hLlQcq6Kd7WKkIkw9rETgTe9r9RPwOSNKBgpuB+Wh2zvR306EdFXiDslKN +xB6tWCmfpv+bGt6N5neYA4s7vMHR2vZaPXb0clQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53790: bpf: Zeroing allocated object from slab in bpf memory allocator Date: Tue, 9 Dec 2025 09:02:11 +0900 Message-ID: <2025120940-CVE-2023-53790-6f22@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3239; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=CGi5bdr8n/MkHGOsOZRetb0jCWF8pnl1jkkq+DoKxXE=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnmaU+Xpd9l4fmf2Mp49eSDnCXMn+Kr9LfpLhTkWn80W LLdWm1dRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkPiPDPFPRwKbm0mnrPE+l 5MmeDF/5vWNnFMP8kDyOKxXPH3Jes1phqiWbER94ONsCAA== 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: Zeroing allocated object from slab in bpf memory allocator Currently the freed element in bpf memory allocator may be immediately reused, for htab map the reuse will reinitialize special fields in map value (e.g., bpf_spin_lock), but lookup procedure may still access these special fields, and it may lead to hard-lockup as shown below: NMI backtrace for cpu 16 CPU: 16 PID: 2574 Comm: htab.bin Tainted: G L 6.1.0+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), RIP: 0010:queued_spin_lock_slowpath+0x283/0x2c0 ...... Call Trace: copy_map_value_locked+0xb7/0x170 bpf_map_copy_value+0x113/0x3c0 __sys_bpf+0x1c67/0x2780 __x64_sys_bpf+0x1c/0x20 do_syscall_64+0x30/0x60 entry_SYSCALL_64_after_hwframe+0x46/0xb0 ...... For htab map, just like the preallocated case, these is no need to initialize these special fields in map value again once these fields have been initialized. For preallocated htab map, these fields are initialized through __GFP_ZERO in bpf_map_area_alloc(), so do the similar thing for non-preallocated htab in bpf memory allocator. And there is no need to use __GFP_ZERO for per-cpu bpf memory allocator, because __alloc_percpu_gfp() does it implicitly. The Linux kernel CVE team has assigned CVE-2023-53790 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit 0fd7c5d43339b783ee3301a05f925d1e52ac87c9 and fixed in 6.1.16 with commit 678ea18d6240299fd77d7000c8b1d7e5f274c8af Issue introduced in 6.1 with commit 0fd7c5d43339b783ee3301a05f925d1e52ac87c9 and fixed in 6.2.3 with commit 5d447e04290e78bdc1a3a6c321320d384e09c2f1 Issue introduced in 6.1 with commit 0fd7c5d43339b783ee3301a05f925d1e52ac87c9 and fixed in 6.3 with commit 997849c4b969034e225153f41026657def66d286 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-53790 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: include/linux/bpf.h kernel/bpf/hashtab.c kernel/bpf/memalloc.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/678ea18d6240299fd77d7000c8b1d7e5f274c8af https://git.kernel.org/stable/c/5d447e04290e78bdc1a3a6c321320d384e09c2f1 https://git.kernel.org/stable/c/997849c4b969034e225153f41026657def66d286