{"id":"CVE-2026-142806","summary":"net/sched: sch_teql: fix slaves_lock IRQ deadlock","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/sched: sch_teql: fix slaves_lock IRQ deadlock\n\nThis is a followup of commit e5b811fe7931 (\"net/sched: sch_teql:\nIntroduce slaves_lock to avoid race condition and UAF\") as reported by\nSashiko.\n\nThe issue: master-\u003eslaves_lock serializes the master's ring of slave\nqdiscs.  The control paths -- teql_dequeue(), teql_destroy() and\nteql_qdisc_init() -- take it with spin_lock_bh(), while\nteql_master_xmit() (the master's ndo_start_xmit) takes it with plain\nspin_lock().\n\nnetpoll_send_skb() wraps the transmit in local_irq_save(), and\n__netpoll_send_skb() asserts lockdep_assert_irqs_disabled(), so\nteql_master_xmit() reached from netconsole always acquires slaves_lock\nwith hard IRQs disabled.  On PREEMPT_RT spinlock_t is an rtmutex, and\nDocumentation/locking/locktypes.rst names\n\n\tlocal_irq_disable();\n\tspin_lock(&lock);\n\nas a sequence that breaks there because the rtmutex requires a fully\npreemptible context.  This is reachable without any panic: the nbcon\nprinter thread calls netconsole's write_thread() callback on every\nmessage.  The usual remedy -- folding the IRQ disable into the lock with\nspin_lock_irqsave() -- is unavailable because the local_irq_save() is\nnetpoll's, not ours.\n\nOn non-RT the same asymmetry leaves slaves_lock acquirable with hard IRQs\ndisabled on one path and held with hard IRQs enabled on another.  That is\nonly exploitable during the panic console flush (netconsole is\nCON_NBCON_ATOMIC_UNSAFE, so console_is_usable() admits its write_atomic()\nonly from nbcon_atomic_flush_unsafe(), which panic() alone calls), and\neven then an IRQ-saving lock does not help if the holder oopsed inside the\nsection or was stopped by panic_other_cpus_shutdown().  So the non-RT half\nis hardening; the PREEMPT_RT half is the bug.\n\nThe Fix: take slaves_lock as a raw spinlock with IRQs saved at every\nsite.  Since skb_queue_purge() takes the queue's spinlock_t and may not\nnest inside a raw lock on PREEMPT_RT, move its call in teql_destroy()\noutside the raw section; dat-\u003eq is the dying qdisc's own queue and was\nnever serialized by slaves_lock, so the move is behaviour-neutral.\n\nThe new critical sections contain only RCU pointer assignments and\nnetdev_get_tx_queue(); skb_queue_purge(), netif_wake_queue() and\ndev_reset_queue() are all outside them.  teql_destroy()'s ring walk is\nO(slaves), two pointer loads and a compare per iteration, so even a large\nring is microseconds with IRQs off.  Keeping the purge conditional rather\nthan dropping it outright is the conservative call for a backport.\n\nSome context: commit 6301f6a34ed8 (\"net/sched: sch_teql: move\nrcu_read_lock()/spin_lock() from _bh variants\") hardened the parent\nfix; together they addressed the master-\u003eslaves resurrection\nuse-after-free and the xmit-side BH warning but left the reverse\ndirection -- a hard IRQ re-entering xmit while a control path holds the\nlock -- unaddressed.\n\nConditions to recreate the bug:\n- CONFIG_PREEMPT_RT, CONFIG_NET_SCH_TEQL, CONFIG_DUMMY and\n  CONFIG_NETCONSOLE.\n- Run `ip link add dev teqlslave0 type dummy`, bring teqlslave0 up, attach\n  it with `tc qdisc add dev teqlslave0 root teql0`, and bring teql0 up.\n- Configure a netconsole target on teql0 with explicit local and remote\n  IP addresses and a remote MAC address, then emit a console message.\n  The nbcon printer thread reaches teql_master_xmit() with hard IRQs\n  disabled by netpoll; taking slaves_lock as a spinlock_t is invalid on\n  PREEMPT_RT. No panic or concurrent qdisc change is required.\n- Reachable by an admin with CAP_NET_ADMIN; teql devices exist only in the\n  initial netns (no per-netns ops), so a user namespace does not suffice.","modified":"2026-12-03T05:00:30.392169822Z","published":"2026-12-03T03:11:33.707Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142806.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/04bc5e44895eb83693e42b67b49bcb6707408fda"},{"type":"WEB","url":"https://git.kernel.org/stable/c/08dd03651497288dfc5a4172c6d8367b81b7e5f9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/165711bea6f2938749031d9e3fb3a5ae7b74fede"},{"type":"WEB","url":"https://git.kernel.org/stable/c/87d636b302886e9793bb51bf81f797b2c04197e0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8b2043279dae25483fe1f2d926e76d41ab95c398"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8b38b110e0d2eb107c87c5091e2054ec580485ea"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142806.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142806"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"03c67781254c574ae7fa75e881239a78473bdf42"},{"fixed":"08dd03651497288dfc5a4172c6d8367b81b7e5f9"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"735567bde7401f82b064f9f107b52ee1bf84ed8c"},{"fixed":"8b38b110e0d2eb107c87c5091e2054ec580485ea"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"11402e6e18e96df615cbcc58157818dd604b23ff"},{"fixed":"165711bea6f2938749031d9e3fb3a5ae7b74fede"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"9b7d05cbaa60108642402100efa6aa288dd33023"},{"fixed":"87d636b302886e9793bb51bf81f797b2c04197e0"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"e5b811fe793166aecc59b085c1b7c31262ef2316"},{"fixed":"04bc5e44895eb83693e42b67b49bcb6707408fda"},{"fixed":"8b2043279dae25483fe1f2d926e76d41ab95c398"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"b26aa9d993537a4c3167d8ceead3b7c69c3a0aac"}]}],"versions":["v6.1.192","v6.1.191","v6.1.190","v6.1.189","v6.1.188","v6.1.187","v6.1.186","v6.1.185","v6.1.184","v6.1.183","v6.1.182","v6.1.181","v6.1.180","v6.1.179","v6.1.178","v6.6.162","v6.6.161","v6.6.160","v6.6.159","v6.6.158","v6.6.157","v6.6.156","v6.6.155","v6.6.154","v6.6.153","v6.6.152","v6.6.151","v6.6.150","v6.6.149","v6.6.148","v6.6.147","v6.6.146","v6.6.145","v6.12.116","v6.12.115","v6.12.114","v6.12.113","v6.12.112","v6.12.111","v6.12.110","v6.12.109","v6.12.108","v6.12.107","v6.12.106","v6.12.105","v6.12.104","v6.12.103","v6.12.102","v6.12.101","v6.12.100","v6.12.99","v6.12.98","v6.12.97","v6.18.60","v6.18.59","v6.18.58","v6.18.57","v6.18.56","v6.18.55","v6.18.54","v6.18.53","v6.18.52","v6.18.51","v6.18.50","v6.18.49","v6.18.48","v6.18.47","v6.18.46","v6.18.45","v6.18.44","v6.18.43","v6.18.42","v6.18.41","v6.18.40","v7.1.13","v7.1.12","v7.1.11","v7.1.10","v7.1.9","v7.1.8","v7.1.7","v7.1.6","v7.1.5"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142806.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.1.178"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.6.145"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.12.97"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.18.40"},{"fixed":"6.18.61"}]},{"type":"ECOSYSTEM","events":[{"introduced":"7.1.5"},{"fixed":"7.2"}]},{"type":"ECOSYSTEM","events":[{"introduced":"7.2.0"},{"fixed":"7.3.2"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142806.json"}}],"schema_version":"1.9.2"}