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 6DD5214B07B for ; Wed, 19 Jun 2024 13:38:06 +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=1718804286; cv=none; b=sOCVqzBrsRoSziPXdZPwH0SZsxjVlNQ7h8THBXwWmsSjtW/CU6DwJzFMTFyYlWwSrvv6WQ1h0HIlTGqbU5Kiern+Vtv1OOH3blMTKYbSRkXoNnHaDJqQjk6Yc6fKYDOBhxAiq1cLbuxj4AjhD/Eun4bNxesTUtlGv+XfRaDjbhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718804286; c=relaxed/simple; bh=lvDYsa25Ry3gZdgRlxitkWSuVl6uDoGypukxX1vWXDE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fBZ2r1vb31GGwqxXbnQMvKMcYBb7F9ifZcyJwiNtjZhUMwa+c0oXqfz6RM/qbBaR3QI06YhxNuITFF3NwUog2C8SPVTnC/ZigC2rcQR+mYn3KUbAhwdvSr27cW9fanUxDYW4wv6uWKpP8vgGFMcNhjf4VWiNCfOZuqLGMji27n4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oHfXP07/; 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="oHfXP07/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E682DC2BBFC; Wed, 19 Jun 2024 13:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718804286; bh=lvDYsa25Ry3gZdgRlxitkWSuVl6uDoGypukxX1vWXDE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=oHfXP07/K3hayXzvauzN6QjBpw6kgWpGSFbOTOEYVRMgFR/Ei5SSklQ2cldVPa4Pg Flp1k7HUpelltUHhvJeqSfo8xvIKrY4FSctuTyN6uGr56hxP3RR3f4nkHgcEHfkFTT Jcmj50gEuy1ep+2fEQ29a8b91qbWB3LqkXH87R5A= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-36979: net: bridge: mst: fix vlan use-after-free Date: Wed, 19 Jun 2024 15:35:46 +0200 Message-ID: <2024061945-CVE-2024-36979-b4a6@gregkh> X-Mailer: git-send-email 2.45.2 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=4699; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=lvDYsa25Ry3gZdgRlxitkWSuVl6uDoGypukxX1vWXDE=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlF9zbuybhmqu7LUzNrsWD+fc5Ji7886+Xf82aHhEX+p WjjS2lZHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRQxcY5qdYsliazXujcvbV Ee+QX7uzsibJX2OY7zXp6VU33WVZ/89rsN7OuXQz18hXFAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: net: bridge: mst: fix vlan use-after-free syzbot reported a suspicious rcu usage[1] in bridge's mst code. While fixing it I noticed that nothing prevents a vlan to be freed while walking the list from the same path (br forward delay timer). Fix the rcu usage and also make sure we are not accessing freed memory by making br_mst_vlan_set_state use rcu read lock. [1] WARNING: suspicious RCU usage 6.9.0-rc6-syzkaller #0 Not tainted ----------------------------- net/bridge/br_private.h:1599 suspicious rcu_dereference_protected() usage! ... stack backtrace: CPU: 1 PID: 8017 Comm: syz-executor.1 Not tainted 6.9.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 lockdep_rcu_suspicious+0x221/0x340 kernel/locking/lockdep.c:6712 nbp_vlan_group net/bridge/br_private.h:1599 [inline] br_mst_set_state+0x1ea/0x650 net/bridge/br_mst.c:105 br_set_state+0x28a/0x7b0 net/bridge/br_stp.c:47 br_forward_delay_timer_expired+0x176/0x440 net/bridge/br_stp_timer.c:88 call_timer_fn+0x18e/0x650 kernel/time/timer.c:1793 expire_timers kernel/time/timer.c:1844 [inline] __run_timers kernel/time/timer.c:2418 [inline] __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2429 run_timer_base kernel/time/timer.c:2438 [inline] run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2448 __do_softirq+0x2c6/0x980 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:lock_acquire+0x264/0x550 kernel/locking/lockdep.c:5758 Code: 2b 00 74 08 4c 89 f7 e8 ba d1 84 00 f6 44 24 61 02 0f 85 85 01 00 00 41 f7 c7 00 02 00 00 74 01 fb 48 c7 44 24 40 0e 36 e0 45 <4b> c7 44 25 00 00 00 00 00 43 c7 44 25 09 00 00 00 00 43 c7 44 25 RSP: 0018:ffffc90013657100 EFLAGS: 00000206 RAX: 0000000000000001 RBX: 1ffff920026cae2c RCX: 0000000000000001 RDX: dffffc0000000000 RSI: ffffffff8bcaca00 RDI: ffffffff8c1eaa60 RBP: ffffc90013657260 R08: ffffffff92efe507 R09: 1ffffffff25dfca0 R10: dffffc0000000000 R11: fffffbfff25dfca1 R12: 1ffff920026cae28 R13: dffffc0000000000 R14: ffffc90013657160 R15: 0000000000000246 The Linux kernel CVE team has assigned CVE-2024-36979 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit ec7328b59176 and fixed in 6.1.93 with commit 8ca9a750fc71 Issue introduced in 5.18 with commit ec7328b59176 and fixed in 6.6.33 with commit 4488617e5e99 Issue introduced in 5.18 with commit ec7328b59176 and fixed in 6.8.12 with commit a2b01e65d9ba Issue introduced in 5.18 with commit ec7328b59176 and fixed in 6.9.3 with commit e43dd2b1ec74 Issue introduced in 5.18 with commit ec7328b59176 and fixed in 6.10-rc1 with commit 3a7c1661ae13 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-2024-36979 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: net/bridge/br_mst.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/8ca9a750fc711911ef616ceb627d07357b04545e https://git.kernel.org/stable/c/4488617e5e995a09abe4d81add5fb165674edb59 https://git.kernel.org/stable/c/a2b01e65d9ba8af2bb086d3b7288ca53a07249ac https://git.kernel.org/stable/c/e43dd2b1ec746e105b7db5f9ad6ef14685a615a4 https://git.kernel.org/stable/c/3a7c1661ae1383364cd6092d851f5e5da64d476b