Archive-only list for patches
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Norbert Szetei <norbert@doyensec.com>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH 6.12 77/99] net: bridge: mcast: fix use-after-free of a master VLANs multicast context
Date: Mon, 31 Aug 2026 15:34:46 +0200	[thread overview]
Message-ID: <20260831133403.773566140@linuxfoundation.org> (raw)
In-Reply-To: <20260831133359.740409777@linuxfoundation.org>

6.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Norbert Szetei <norbert@doyensec.com>

commit 50e5c6605cc9c2dd57bd2d1b3459674d19738983 upstream.

br_multicast_toggle_one_vlan() clears BR_VLFLAG_MCAST_ENABLED under
br->multicast_lock before stopping a VLAN's multicast context.  That is
the teardown handshake: lockless readers gate on the flag through
br_multicast_ctx_should_use() -> br_multicast_ctx_vlan_disabled(), so
once it is cleared under the lock no reader can arm the context again.

For a master VLAN the handshake never runs.  __vlan_del() clears
BRIDGE_VLAN_INFO_BRENTRY before calling br_vlan_put_master(), so
br_multicast_toggle_one_vlan(masterv, false) returns early on
!br_vlan_is_brentry(vlan): the flag stays set and br->multicast_lock is
never taken.  br_vlan_put_master() then drains the context in
br_multicast_ctx_deinit() and frees the VLAN through call_rcu(), while a
reader still inside rcu_read_lock() sees the context as enabled and
re-arms it.  The port and port-VLAN branch of the function has no
br_vlan_is_brentry() test and flips the flag under br->multicast_lock,
so it is not affected.

The reader is the bridge transmit path.  For a master VLAN
br_multicast_rcv() selects brmctx = &vlan->br_mcast_ctx with
pmctx = NULL, so IGMP sent to the bridge device re-arms the context's
timers after br_multicast_ctx_deinit() has already stopped them.

  BUG: KASAN: slab-use-after-free in detach_if_pending+0x412/0x4a0
  Write of size 8 at addr ffff88810ac39918 by task brmc/601
   __mod_timer+0x51a/0xc50
   br_multicast_host_join+0x25b/0x390
   __br_multicast_add_group+0x468/0x530
   br_ip4_multicast_add_group+0x1a0/0x260
   br_multicast_rcv+0x2cda/0x61e0
   br_dev_xmit+0x6c4/0x1540
  Allocated by task 610:
   br_vlan_add+0x111/0xb40
   br_vlan_info+0x370/0x3e0
  Freed by task 0:
   kfree+0x1a7/0x4f0
   rcu_core+0x7dc/0x10a0

Only test br_vlan_is_brentry() when enabling, like the
br_multicast_ctx_vlan_global_disabled() test next to it.  Disabling then
always clears BR_VLFLAG_MCAST_ENABLED under br->multicast_lock before
br_multicast_ctx_deinit() drains the context.

Fixes: 7b54aaaf53cb ("net: bridge: multicast: add vlan state initialization and control")
Cc: stable@vger.kernel.org
Signed-off-by: Norbert Szetei <norbert@doyensec.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/D400F6C7-543A-4B79-9E5B-D1D8974DE5C9@doyensec.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/bridge/br_multicast.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -4313,8 +4313,8 @@ void br_multicast_toggle_one_vlan(struct
 	if (br_vlan_is_master(vlan)) {
 		br = vlan->br;
 
-		if (!br_vlan_is_brentry(vlan) ||
-		    (on &&
+		if (on &&
+		    (!br_vlan_is_brentry(vlan) ||
 		     br_multicast_ctx_vlan_global_disabled(&vlan->br_mcast_ctx)))
 			return;
 



  parent reply	other threads:[~2026-08-31 13:52 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 13:33 [PATCH 6.12 00/99] 6.12.108-rc1 review Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 01/99] RDMA/rxe: Fix responder UAF on IB_QP_MAX_DEST_RD_ATOMIC modify_qp Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 02/99] RDMA/rxe: Fix OOB in free_rd_atomic_resources() Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 03/99] KVM: x86/mmu: Check write tracking in all address spaces Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 04/99] ext4: dont enable DAX on new encrypted files Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 05/99] io_uring/io-wq: fix worker accounting when canceling creation callbacks Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 06/99] nvme-tcp: fix usage of page_frag_cache Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 07/99] HID: uhid: convert to hid_safe_input_report() Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 08/99] selinux: use known type instead of void pointer Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 09/99] selinux: avoid unnecessary indirection in struct level_datum Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 10/99] selinux: make more use of str_read() when loading the policy Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 11/99] selinux: use u16 for security classes Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 12/99] selinux: more strict policy parsing Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 13/99] selinux: reject a permission value exceeding the class permission count Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 14/99] selinux: require a classs permission values to cover its " Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 15/99] perf: Reject exited events as group leaders Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 16/99] jfs: add check read-only before truncation in jfs_truncate_nolock() Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 17/99] jfs: add check read-only before txBeginAnon() call Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 18/99] ibmvnic: Use kernel helpers for hex dumps Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 19/99] jfs: Fix null-ptr-deref in jfs_ioc_trim Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 20/99] exfat: fix double free in delayed_free Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 21/99] media: platform: exynos4-is: Add hardware sync wait to fimc_is_hw_change_mode() Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 22/99] mISDN: hfcpci: Fix warning when deleting uninitialized timer Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 23/99] can: j1939: implement NETDEV_UNREGISTER notification handler Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 24/99] can: j1939: add missing calls in " Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 25/99] can: j1939: make j1939_sk_bind() fail if device is no longer registered Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 26/99] smc: Fix use-after-free in __pnet_find_base_ndev() Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 27/99] KVM: arm64: Prevent access to vCPU events before init Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 28/99] smc: Use __sk_dst_get() and dst_dev_rcu() in in smc_clc_prfx_set() Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 29/99] smc: Use __sk_dst_get() and dst_dev_rcu() in smc_clc_prfx_match() Greg Kroah-Hartman
2026-08-31 13:33 ` [PATCH 6.12 30/99] ASoC: nau8821: Cancel delayed work on component remove Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 31/99] bpf: Fix use-after-free in offloaded map/prog info fill Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 32/99] riscv: Fix register corruption from uninitialized cregs on error Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 33/99] Revert "PM: sleep: Use complete() in device_pm_sleep_init()" Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 34/99] ASoC: nau8821: Cancel pending work before suspend Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 35/99] smc: Use __sk_dst_get() and dst_dev_rcu() in smc_vlan_by_tcpsk() Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 36/99] selinux: switch two allocations to use kzalloc_objs() Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 37/99] ring buffer: Propagate __rb_map_vma return value to caller Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 38/99] veth: fix OOB txq access in veth_poll() with asymmetric queue counts Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 39/99] powerpc/hv-gpci: fix preempt count leak in sysfs show paths Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 40/99] ksmbd: harden file lifetime during session teardown Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 41/99] nilfs2: correct return value kernel-doc descriptions for ioctl functions Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 42/99] nilfs2: reject invalid block index in GC ioctl Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 43/99] nfc: nci: add data_len bound checks to activation parameter extractors Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 44/99] HID: pidff: Rework pidff_set_time() to fix warnings Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 45/99] HID: pidff: Use ARRAY_SIZE macro instead of sizeof Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 46/99] HID: pidff: clang-format pass Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 47/99] HID: pidff: fix OOB write when hid->inputs is empty Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 48/99] HID: asus: simplify RGB init sequence Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 49/99] HID: asus: fix missing hid_is_usb() check Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 50/99] HID: ft260: validate i2c input report length Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 51/99] HID: ft260: fix stack-use-after-return write in I2C read race Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 52/99] HID: uclogic: fix use-after-free of inrange_timer on remove Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 53/99] Bluetooth: hci_sync: Use bt_dev_err() to log error message in hci_update_event_filter_sync() Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 54/99] Bluetooth: hci_sync: Fix accept list UAF during suspend Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 55/99] HID: magicmouse: prevent unbounded recursion in magicmouse_raw_event() Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 56/99] fpga: dfl: fme: add error handling Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 57/99] accessibility: speakup: unregister tty ldisc on later init failures Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 58/99] usb: xhci: Handle USB3 port events when there is one roothub Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 59/99] xhci: dbgtty: Fix unregister on tty_register_driver() failure Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 60/99] xhci: dbgtty: Fix unregister on tty_alloc_driver() failure Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 61/99] fuse: fix invalidate lock leak on setattr writeback failure Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 62/99] fuse: fix invalidate lock leak on open O_TRUNC DAX failure Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 63/99] usb: usbtest: disable dynamic ID support Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 64/99] usb: gadget: f_tcm: keep port count until LUN teardown completes Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 65/99] tls: device: fix out-of-bounds write in tls_append_frag() Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 66/99] gtp: serialize PDP context updates Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 67/99] x86/CPU/AMD: Carve out a Zen5 models range Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 68/99] net/tcp: fix TCP-AO key deletion in VRFs Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 69/99] tcp: fix AO info use-after-free in tcp_ao_connect_init() Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 70/99] net/tcp-ao: fix use-after-free of current_key on reconnect to another peer Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 71/99] xfrm: espintcp: fix UAF during close Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 72/99] xfrm: drop ESP-in-TCP packets with no ingress device Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 73/99] xfrm: avoid lock inversion in nat keepalive work Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 74/99] xfrm: ah6: validate routing header segments_left Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 75/99] xfrm: fix xfrm_state_construct() auth-trunc leak Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 76/99] xfrm: bound nat keepalive state collection Greg Kroah-Hartman
2026-08-31 13:34 ` Greg Kroah-Hartman [this message]
2026-08-31 13:34 ` [PATCH 6.12 78/99] ipv6: seg6: clear IPv4 control block on IPIP decapsulation Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 79/99] batman-adv: reject unrepresentable multicast TVLV offsets Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 80/99] vxlan: keep the last remote linked during FDB flush Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 81/99] netfilter: nf_tables: dont queue packet path object notifications Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 82/99] mm/swap: reject swapon() on filesystem-level encrypted files Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 83/99] crypto: qcom-rng - Enable clock in hwrng case Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 84/99] crypto: qcom-rng - Allow zero as a random number Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 85/99] crypto: qcom-rng - Remove crypto_rng interface Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 86/99] crypto: atmel-tdes - use scatterlist length before DMA mapping Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 87/99] crypto: qce - fix CCM AAD buffer underallocation Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 88/99] crypto: mxs-dcp - fix source scatterlist length access Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 89/99] crypto: qce - Remove unsafe/deprecated algorithms Greg Kroah-Hartman
2026-08-31 13:34 ` [PATCH 6.12 90/99] KVM: s390: vsie: zero stale crypto bits Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 91/99] usb: core: Add lock to usb_wakeup_notification() Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 92/99] usb: core: Strengthen error handling in hub_hub_status() Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 93/99] ALSA: usb-audio: fix OOB write in snd_usbmidi_novation_output() Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 94/99] ALSA: usb-audio: Complete cleanup after system-resume errors Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 95/99] USB: serial: option: fix slab OOB read in interrupt URB callback Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 96/99] USB: serial: spcp8x5: drop broken carrier detect support Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 97/99] USB: c67x00: fix use-after-free in c67x00_add_iso_urb() Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 98/99] wifi: mt76: mt7925: ensure tx headroom in usb_sdio_tx_prepare_skb Greg Kroah-Hartman
2026-08-31 13:35 ` [PATCH 6.12 99/99] usb: usbfs: fix use-after-free of usb_device in usbdev_release() Greg Kroah-Hartman
2026-08-31 18:15 ` [PATCH 6.12 00/99] 6.12.108-rc1 review Francesco Dolcini
2026-08-31 19:00 ` Florian Fainelli
2026-08-31 19:12 ` Brett A C Sheffield
2026-08-31 22:04 ` Peter Schneider
2026-09-01  1:59 ` Dominique Martinet
2026-09-01  4:56 ` Harshit Mogalapalli
2026-09-01  8:44 ` Pavel Machek
2026-09-01 16:45 ` Shuah Khan
2026-09-01 22:30 ` Miguel Ojeda
2026-09-01 23:10 ` Ron Economos
2026-09-02  2:28 ` Barry K. Nathan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260831133403.773566140@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=norbert@doyensec.com \
    --cc=patches@lists.linux.dev \
    --cc=razor@blackwall.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox