Skip to content

Conversation

@roxanan1996
Copy link
Contributor

DESCRIPTION

This started with fixing CVE-2025-38000, but it cascaded into more fixes
dependencies. Here's a brief description of what happened:

  1. First commit
    ccb65ca ("sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()")
    is the fix for CVE-2025-38000. It was not a clean cherry pick due to a commit
    that was backported first.
  2. d7dfc52 ("net/sched: Always pass notifications when child class becomes empty")
    is a bf for the previous commit, but it turned out it is a CVE (CVE-2025-38350)
    This one has also a bf, the last commit
    8cb9852 ("net/sched: ets: use old 'nbands' while purging unused classes").
    Also a CVE.
    But it was not a clean cherry pick, hence the commits in between including
    commit 5c6a24d ("net_sched: ets: fix a race in ets_qdisc_change()")
    that turned out to be a CVE as well (CVE-2025-38107)

COMMITS

sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()

jira VULN-68350
cve CVE-2025-38000
commit-author Cong Wang <xiyou.wangcong@gmail.com>
commit 3f981138109f63232a5fb7165938d4c945cc1b9d
upstream-diff |
	Adjusted context due to commit
	ac9fe7dd8e730 ("net_sched: hfsc: Address reentrant enqueue adding class to eltree twice")
	being backported before this one.
net/sched: Always pass notifications when child class becomes empty

jira VULN-136682
cve CVE-2025-38350
commit-author Lion Ackermann <nnamrec@gmail.com>
commit 103406b38c600fec1fe375a77b27d87e314aea09
net_sched: sch_ets: implement lockless ets_dump()

jira VULN-71723
cve-pre CVE-2025-38107
commit-author Eric Dumazet <edumazet@google.com>
commit c5f1dde7f731e7bf2e7c169ca42cb4989fc2f8b9
sch_ets: make est_qlen_notify() idempotent

jira VULN-71723
cve-pre CVE-2025-38107
commit-author Cong Wang <xiyou.wangcong@gmail.com>
commit a7a15f39c682ac4268624da2abdb9114bdde96d5
net: sched: tbf: don't call qdisc_put() while holding tree lock

jira VULN-71723
cve-pre CVE-2025-38107
commit-author Zhengchao Shao <shaozhengchao@huawei.com>
commit b05972f01e7d30419987a1f221b5593668fd6448
net_sched: tbf: fix a race in tbf_change()

jira VULN-71723
cve-pre CVE-2025-38107
commit-author Eric Dumazet <edumazet@google.com>
commit 43eb466041216d25dedaef1c383ad7bd89929cbc
net_sched: ets: fix a race in ets_qdisc_change()

jira VULN-71723
cve CVE-2025-38107
commit-author Eric Dumazet <edumazet@google.com>
commit d92adacdd8c2960be856e0b82acc5b7c5395fddb
net/sched: ets: use old 'nbands' while purging unused classes

jira VULN-136258
cve CVE-2025-38684
commit-author Davide Caratti <dcaratti@redhat.com>
commit 87c6efc5ce9c126ae4a781bc04504b83780e3650

TESTING

BUILD

> grep -E -B 5 -A 5 '\[TIMER\]|^Starting Build' /home/rnicolescu/ciq/kernels/lts-8.6_sched/kernel-build-after.log
/home/rnicolescu/ciq/kernels/lts-8.6_sched/kernel-src-tree
Running make mrproper...
  CLEAN   cscope.out.po cscope.out cscope.out.in cscope.files
[TIMER]{MRPROPER}: 3s
x86_64 architecture detected, copying config
'configs/kernel-x86_64.config' -> '.config'
Setting Local Version for build
CONFIG_LOCALVERSION="-rnicolescu_ciqlts8_6_sched-8cb985214407b"
Making olddefconfig
--
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --olddefconfig Kconfig
#
# configuration written to .config
#
Starting Build
scripts/kconfig/conf  --syncconfig Kconfig
  SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/include/generated/asm/unistd_32_ia32.h
  SYSHDR  arch/x86/include/generated/asm/unistd_64_x32.h
  SYSTBL  arch/x86/include/generated/asm/syscalls_64.h
--
  LD [M]  sound/usb/usx2y/snd-usb-usx2y.ko
  LD [M]  sound/virtio/virtio_snd.ko
  LD [M]  sound/x86/snd-hdmi-lpe-audio.ko
  LD [M]  sound/xen/snd_xen_front.ko
  LD [M]  virt/lib/irqbypass.ko
[TIMER]{BUILD}: 1399s
Making Modules
  INSTALL arch/x86/crypto/blowfish-x86_64.ko
  INSTALL arch/x86/crypto/camellia-aesni-avx-x86_64.ko
  INSTALL arch/x86/crypto/camellia-aesni-avx2.ko
  INSTALL arch/x86/crypto/camellia-x86_64.ko
--
  INSTALL sound/virtio/virtio_snd.ko
  INSTALL sound/x86/snd-hdmi-lpe-audio.ko
  INSTALL sound/xen/snd_xen_front.ko
  INSTALL virt/lib/irqbypass.ko
  DEPMOD  4.18.0-rnicolescu_ciqlts8_6_sched-8cb985214407b+
[TIMER]{MODULES}: 9s
Making Install
sh ./arch/x86/boot/install.sh 4.18.0-rnicolescu_ciqlts8_6_sched-8cb985214407b+ arch/x86/boot/bzImage \
	System.map "/boot"
[TIMER]{INSTALL}: 31s
Checking kABI
kABI check passed
Setting Default Kernel to /boot/vmlinuz-4.18.0-rnicolescu_ciqlts8_6_sched-8cb985214407b+ and Index to 2
The default is /boot/loader/entries/da29368f0a2f478eae4042eedca577da-4.18.0-rnicolescu_ciqlts8_6_sched-8cb985214407b+.conf with index 2 and kernel /boot/vmlinuz-4.18.0-rnicolescu_ciqlts8_6_sched-8cb985214407b+
The default is /boot/loader/entries/da29368f0a2f478eae4042eedca577da-4.18.0-rnicolescu_ciqlts8_6_sched-8cb985214407b+.conf with index 2 and kernel /boot/vmlinuz-4.18.0-rnicolescu_ciqlts8_6_sched-8cb985214407b+
Generating grub configuration file ...
done
Hopefully Grub2.0 took everything ... rebooting after time metrices
[TIMER]{MRPROPER}: 3s
[TIMER]{BUILD}: 1399s
[TIMER]{MODULES}: 9s
[TIMER]{INSTALL}: 31s
[TIMER]{TOTAL} 1446s
Rebooting in 10 seconds

kernel-build-after.log

Kselftests

> /home/rnicolescu/ciq/kernel-tools/kselftest-diff.sh /home/rnicolescu/ciq/kernels/lts-8.6_sched
/home/rnicolescu/ciq/kernels/lts-8.6_sched/kselftest-before.log
212
/home/rnicolescu/ciq/kernels/lts-8.6_sched/kselftest-after.log
212
Before: /home/rnicolescu/ciq/kernels/lts-8.6_sched/kselftest-before.log
After: /home/rnicolescu/ciq/kernels/lts-8.6_sched/kselftest-after.log
Diff:
No differences found.

kselftest-before.log
kselftest-after.log

Check_kernel_commits

> python3 /home/rnicolescu/ciq/kernel-src-tree-tools/check_kernel_commits.py --repo /home/rnicolescu/ciq/kernels/lts-8.6_sched/kernel-src-tree --pr_branch {rnicolescu}_ciqlts8_6_sched --base_branch origin/ciqlts8_6 --check-cves
All referenced commits exist upstream and have no Fixes: tags.

Run interdiff

[DIFF] PR commit ccb65ca03cc1f (sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()) → upstream 3f981138109f
Differences found:

  diff -u b/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
  --- b/net/sched/sch_hfsc.c
  +++ b/net/sched/sch_hfsc.c
  @@ -1569,6 +1569,9 @@ INTERDIFF: rejected hunk from patch2, cannot diff context
   		return err;
   	}

  +	sch->qstats.backlog += len;
  +	sch->q.qlen++;
  +
   	if (first && !cl->cl_nactive) {
   		if (cl->cl_flags & HFSC_RSC)
   			init_ed(cl, len);
  @@ -1579,6 +1579,9 @@ INTERDIFF: rejected hunk from patch1, cannot diff context
   		return err;
   	}

  +	sch->qstats.backlog += len;
  +	sch->q.qlen++;
  +
   	if (first && !cl_in_el_or_vttree(cl)) {
   		if (cl->cl_flags & HFSC_RSC)
   			init_ed(cl, len);

As explained in the commit description
ac9fe7d ("net_sched: hfsc: Address reentrant enqueue adding class to eltree twice")
was backported before this one. The rest is interdiff noise.

[DIFF] PR commit d7dfc528fa72e (net/sched: Always pass notifications when child class becomes empty) → upstream 103406b38c60
Differences found:

  diff -u b/net/sched/sch_api.c b/net/sched/sch_api.c
  --- b/net/sched/sch_api.c
  +++ b/net/sched/sch_api.c
  @@ -773,8 +772,6 @@ INTERDIFF: rejected hunk from patch1, cannot diff context
   	bool notify;
   	int drops;

  -	if (n == 0 && len == 0)
  -		return;
   	drops = max_t(int, n, 0);
   	rcu_read_lock();
   	while ((parentid = sch->parent)) {
  @@ -786,8 +785,6 @@ INTERDIFF: rejected hunk from patch2, cannot diff context
   	bool notify;
   	int drops;

  -	if (n == 0 && len == 0)
  -		return;
   	drops = max_t(int, n, 0);
   	rcu_read_lock();
   	while ((parentid = sch->parent)) {
  @@ -784,7 +784,7 @@
   		/* Notify parent qdisc only if child qdisc becomes empty. */
   		notify = !sch->q.qlen;
   		/* TODO: perform the search on a per txq basis */
  -		sch = qdisc_lookup_rcu(qdisc_dev(sch), TC_H_MAJ(parentid));
  +		sch = qdisc_lookup(qdisc_dev(sch), TC_H_MAJ(parentid));
   		if (sch == NULL) {
   		}
   		cops = sch->ops->cl_ops;

Only last chunk is relevant. Due to missing commit
7eb3223 ("net/sched: fix lockdep splat in qdisc_tree_reduce_backlog()")

[DIFF] PR commit d37f182e1e734 (net_sched: sch_ets: implement lockless ets_dump()) → upstream c5f1dde7f731
Differences found:

  diff -u b/net/sched/sch_ets.c b/net/sched/sch_ets.c
  --- b/net/sched/sch_ets.c
  +++ b/net/sched/sch_ets.c
  @@ -696,3 +696,3 @@
                q->classes[i].deficit = 0;
  -             gnet_stats_basic_sync_init(&q->classes[i].bstats);
  +             memset(&q->classes[i].bstats, 0, sizeof(q->classes[i].bstats));
                memset(&q->classes[i].qstats, 0, sizeof(q->classes[i].qstats));

Due to missing commit
67c9e62 ("net: sched: Protect Qdisc::bstats with u64_stats")
and
50dc9a8 ("net: sched: Merge Qdisc::bstats and Qdisc::cpu_bstats data types")

Run jira_pr_check

> python3 /home/rnicolescu/ciq/kernel-src-tree-tools/jira_pr_check.py --kernel-src-tree /home/rnicolescu/ciq/kernels/lts-8.6_sched/kernel-src-tree --merge-target {rnicolescu}_ciqlts8_6_sched --pr-branch origin/ciqlts8_6

## JIRA PR Check Results

✅ **No issues found!**


---
**Summary:** Checked 0 commit(s) total.

jira VULN-68350
cve CVE-2025-38000
commit-author Cong Wang <xiyou.wangcong@gmail.com>
commit 3f98113
upstream-diff |
	Adjusted context due to commit
	ac9fe7d ("net_sched: hfsc: Address reentrant enqueue adding class to eltree twice")
	being backported before this one.

When enqueuing the first packet to an HFSC class, hfsc_enqueue() calls the
child qdisc's peek() operation before incrementing sch->q.qlen and
sch->qstats.backlog. If the child qdisc uses qdisc_peek_dequeued(), this may
trigger an immediate dequeue and potential packet drop. In such cases,
qdisc_tree_reduce_backlog() is called, but the HFSC qdisc's qlen and backlog
have not yet been updated, leading to inconsistent queue accounting. This
can leave an empty HFSC class in the active list, causing further
consequences like use-after-free.

This patch fixes the bug by moving the increment of sch->q.qlen and
sch->qstats.backlog before the call to the child qdisc's peek() operation.
This ensures that queue length and backlog are always accurate when packet
drops or dequeues are triggered during the peek.

Fixes: 12d0ad3 ("net/sched/sch_hfsc.c: handle corner cases where head may change invalidating calculated deadline")
	Reported-by: Mingi Cho <mincho@theori.io>
	Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
	Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250518222038.58538-2-xiyou.wangcong@gmail.com
	Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 3f98113)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-136682
cve CVE-2025-38350
commit-author Lion Ackermann <nnamrec@gmail.com>
commit 103406b

Certain classful qdiscs may invoke their classes' dequeue handler on an
enqueue operation. This may unexpectedly empty the child qdisc and thus
make an in-flight class passive via qlen_notify(). Most qdiscs do not
expect such behaviour at this point in time and may re-activate the
class eventually anyways which will lead to a use-after-free.

The referenced fix commit attempted to fix this behavior for the HFSC
case by moving the backlog accounting around, though this turned out to
be incomplete since the parent's parent may run into the issue too.
The following reproducer demonstrates this use-after-free:

    tc qdisc add dev lo root handle 1: drr
    tc filter add dev lo parent 1: basic classid 1:1
    tc class add dev lo parent 1: classid 1:1 drr
    tc qdisc add dev lo parent 1:1 handle 2: hfsc def 1
    tc class add dev lo parent 2: classid 2:1 hfsc rt m1 8 d 1 m2 0
    tc qdisc add dev lo parent 2:1 handle 3: netem
    tc qdisc add dev lo parent 3:1 handle 4: blackhole

    echo 1 | socat -u STDIN UDP4-DATAGRAM:127.0.0.1:8888
    tc class delete dev lo classid 1:1
    echo 1 | socat -u STDIN UDP4-DATAGRAM:127.0.0.1:8888

Since backlog accounting issues leading to a use-after-frees on stale
class pointers is a recurring pattern at this point, this patch takes
a different approach. Instead of trying to fix the accounting, the patch
ensures that qdisc_tree_reduce_backlog always calls qlen_notify when
the child qdisc is empty. This solves the problem because deletion of
qdiscs always involves a call to qdisc_reset() and / or
qdisc_purge_queue() which ultimately resets its qlen to 0 thus causing
the following qdisc_tree_reduce_backlog() to report to the parent. Note
that this may call qlen_notify on passive classes multiple times. This
is not a problem after the recent patch series that made all the
classful qdiscs qlen_notify() handlers idempotent.

Fixes: 3f98113 ("sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()")
	Signed-off-by: Lion Ackermann <nnamrec@gmail.com>
	Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
	Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/d912cbd7-193b-4269-9857-525bee8bbb6a@gmail.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 103406b)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-71723
cve-pre CVE-2025-38107
commit-author Eric Dumazet <edumazet@google.com>
commit c5f1dde

Instead of relying on RTNL, ets_dump() can use READ_ONCE()
annotations, paired with WRITE_ONCE() ones in ets_change().

	Signed-off-by: Eric Dumazet <edumazet@google.com>
	Reviewed-by: Simon Horman <horms@kernel.org>
	Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c5f1dde)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-71723
cve-pre CVE-2025-38107
commit-author Cong Wang <xiyou.wangcong@gmail.com>
commit a7a15f3

est_qlen_notify() deletes its class from its active list with
list_del() when qlen is 0, therefore, it is not idempotent and
not friendly to its callers, like fq_codel_dequeue().

Let's make it idempotent to ease qdisc_tree_reduce_backlog() callers'
life. Also change other list_del()'s to list_del_init() just to be
extra safe.

	Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg>
	Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Link: https://patch.msgid.link/20250403211033.166059-6-xiyou.wangcong@gmail.com
	Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit a7a15f3)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-71723
cve-pre CVE-2025-38107
commit-author Zhengchao Shao <shaozhengchao@huawei.com>
commit b05972f

The issue is the same to commit c2999f7 ("net: sched: multiq: don't
call qdisc_put() while holding tree lock"). Qdiscs call qdisc_put() while
holding sch tree spinlock, which results sleeping-while-atomic BUG.

Fixes: c266f64 ("net: sched: protect block state with mutex")
	Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Link: https://lore.kernel.org/r/20220826013930.340121-1-shaozhengchao@huawei.com
	Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit b05972f)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-71723
cve-pre CVE-2025-38107
commit-author Eric Dumazet <edumazet@google.com>
commit 43eb466

Gerrard Tai reported a race condition in TBF, whenever SFQ perturb timer
fires at the wrong time.

The race is as follows:

CPU 0                                 CPU 1
[1]: lock root
[2]: qdisc_tree_flush_backlog()
[3]: unlock root
 |
 |                                    [5]: lock root
 |                                    [6]: rehash
 |                                    [7]: qdisc_tree_reduce_backlog()
 |
[4]: qdisc_put()

This can be abused to underflow a parent's qlen.

Calling qdisc_purge_queue() instead of qdisc_tree_flush_backlog()
should fix the race, because all packets will be purged from the qdisc
before releasing the lock.

Fixes: b05972f ("net: sched: tbf: don't call qdisc_put() while holding tree lock")
	Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg>
	Suggested-by: Gerrard Tai <gerrard.tai@starlabs.sg>
	Signed-off-by: Eric Dumazet <edumazet@google.com>
	Cc: Zhengchao Shao <shaozhengchao@huawei.com>
Link: https://patch.msgid.link/20250611111515.1983366-4-edumazet@google.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 43eb466)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-71723
cve CVE-2025-38107
commit-author Eric Dumazet <edumazet@google.com>
commit d92adac

Gerrard Tai reported a race condition in ETS, whenever SFQ perturb timer
fires at the wrong time.

The race is as follows:

CPU 0                                 CPU 1
[1]: lock root
[2]: qdisc_tree_flush_backlog()
[3]: unlock root
 |
 |                                    [5]: lock root
 |                                    [6]: rehash
 |                                    [7]: qdisc_tree_reduce_backlog()
 |
[4]: qdisc_put()

This can be abused to underflow a parent's qlen.

Calling qdisc_purge_queue() instead of qdisc_tree_flush_backlog()
should fix the race, because all packets will be purged from the qdisc
before releasing the lock.

Fixes: b05972f ("net: sched: tbf: don't call qdisc_put() while holding tree lock")
	Reported-by: Gerrard Tai <gerrard.tai@starlabs.sg>
	Suggested-by: Gerrard Tai <gerrard.tai@starlabs.sg>
	Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250611111515.1983366-5-edumazet@google.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit d92adac)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
jira VULN-136258
cve CVE-2025-38684
commit-author Davide Caratti <dcaratti@redhat.com>
commit 87c6efc

Shuang reported sch_ets test-case [1] crashing in ets_class_qlen_notify()
after recent changes from Lion [2]. The problem is: in ets_qdisc_change()
we purge unused DWRR queues; the value of 'q->nbands' is the new one, and
the cleanup should be done with the old one. The problem is here since my
first attempts to fix ets_qdisc_change(), but it surfaced again after the
recent qdisc len accounting fixes. Fix it purging idle DWRR queues before
assigning a new value of 'q->nbands', so that all purge operations find a
consistent configuration:

 - old 'q->nbands' because it's needed by ets_class_find()
 - old 'q->nstrict' because it's needed by ets_class_is_strict()

 BUG: kernel NULL pointer dereference, address: 0000000000000000
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] SMP NOPTI
 CPU: 62 UID: 0 PID: 39457 Comm: tc Kdump: loaded Not tainted 6.12.0-116.el10.x86_64 #1 PREEMPT(voluntary)
 Hardware name: Dell Inc. PowerEdge R640/06DKY5, BIOS 2.12.2 07/09/2021
 RIP: 0010:__list_del_entry_valid_or_report+0x4/0x80
 Code: ff 4c 39 c7 0f 84 39 19 8e ff b8 01 00 00 00 c3 cc cc cc cc 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa <48> 8b 17 48 8b 4f 08 48 85 d2 0f 84 56 19 8e ff 48 85 c9 0f 84 ab
 RSP: 0018:ffffba186009f400 EFLAGS: 00010202
 RAX: 00000000000000d6 RBX: 0000000000000000 RCX: 0000000000000004
 RDX: ffff9f0fa29b69c0 RSI: 0000000000000000 RDI: 0000000000000000
 RBP: ffffffffc12c2400 R08: 0000000000000008 R09: 0000000000000004
 R10: ffffffffffffffff R11: 0000000000000004 R12: 0000000000000000
 R13: ffff9f0f8cfe0000 R14: 0000000000100005 R15: 0000000000000000
 FS:  00007f2154f37480(0000) GS:ffff9f269c1c0000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000000 CR3: 00000001530be001 CR4: 00000000007726f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
 PKRU: 55555554
 Call Trace:
  <TASK>
  ets_class_qlen_notify+0x65/0x90 [sch_ets]
  qdisc_tree_reduce_backlog+0x74/0x110
  ets_qdisc_change+0x630/0xa40 [sch_ets]
  __tc_modify_qdisc.constprop.0+0x216/0x7f0
  tc_modify_qdisc+0x7c/0x120
  rtnetlink_rcv_msg+0x145/0x3f0
  netlink_rcv_skb+0x53/0x100
  netlink_unicast+0x245/0x390
  netlink_sendmsg+0x21b/0x470
  ____sys_sendmsg+0x39d/0x3d0
  ___sys_sendmsg+0x9a/0xe0
  __sys_sendmsg+0x7a/0xd0
  do_syscall_64+0x7d/0x160
  entry_SYSCALL_64_after_hwframe+0x76/0x7e
 RIP: 0033:0x7f2155114084
 Code: 89 02 b8 ff ff ff ff eb bb 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 80 3d 25 f0 0c 00 00 74 13 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 48 83 ec 28 89 54 24 1c 48 89
 RSP: 002b:00007fff1fd7a988 EFLAGS: 00000202 ORIG_RAX: 000000000000002e
 RAX: ffffffffffffffda RBX: 0000560ec063e5e0 RCX: 00007f2155114084
 RDX: 0000000000000000 RSI: 00007fff1fd7a9f0 RDI: 0000000000000003
 RBP: 00007fff1fd7aa60 R08: 0000000000000010 R09: 000000000000003f
 R10: 0000560ee9b3a010 R11: 0000000000000202 R12: 00007fff1fd7aae0
 R13: 000000006891ccde R14: 0000560ec063e5e0 R15: 00007fff1fd7aad0
  </TASK>

 [1] https://lore.kernel.org/netdev/e08c7f4a6882f260011909a868311c6e9b54f3e4.1639153474.git.dcaratti@redhat.com/
 [2] https://lore.kernel.org/netdev/d912cbd7-193b-4269-9857-525bee8bbb6a@gmail.com/

	Cc: stable@vger.kernel.org
Fixes: 103406b ("net/sched: Always pass notifications when child class becomes empty")
Fixes: c062f2a ("net/sched: sch_ets: don't remove idle classes from the round-robin list")
Fixes: dcc68b4 ("net: sch_ets: Add a new Qdisc")
	Reported-by: Li Shuang <shuali@redhat.com>
Closes: https://issues.redhat.com/browse/RHEL-108026
	Reviewed-by: Petr Machata <petrm@nvidia.com>
Co-developed-by: Ivan Vecera <ivecera@redhat.com>
	Signed-off-by: Ivan Vecera <ivecera@redhat.com>
	Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Link: https://patch.msgid.link/7928ff6d17db47a2ae7cc205c44777b1f1950545.1755016081.git.dcaratti@redhat.com
	Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 87c6efc)
	Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/20752688195

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

🔍 Interdiff Analysis

  • ⚠️ PR commit ccb65ca03cc1 (sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()) → upstream 3f981138109f
    Differences found:
diff -u b/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
--- b/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1569,6 +1569,9 @@ INTERDIFF: rejected hunk from patch2, cannot diff context
 		return err;
 	}
 
+	sch->qstats.backlog += len;
+	sch->q.qlen++;
+
 	if (first && !cl->cl_nactive) {
 		if (cl->cl_flags & HFSC_RSC)
 			init_ed(cl, len);
@@ -1579,6 +1579,9 @@ INTERDIFF: rejected hunk from patch1, cannot diff context
 		return err;
 	}
 
+	sch->qstats.backlog += len;
+	sch->q.qlen++;
+
 	if (first && !cl_in_el_or_vttree(cl)) {
 		if (cl->cl_flags & HFSC_RSC)
 			init_ed(cl, len);
  • ⚠️ PR commit d7dfc528fa72 (net/sched: Always pass notifications when child class becomes empty) → upstream 103406b38c60
    Differences found:
diff -u b/net/sched/sch_api.c b/net/sched/sch_api.c
--- b/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -773,8 +772,6 @@ INTERDIFF: rejected hunk from patch1, cannot diff context
 	bool notify;
 	int drops;
 
-	if (n == 0 && len == 0)
-		return;
 	drops = max_t(int, n, 0);
 	rcu_read_lock();
 	while ((parentid = sch->parent)) {
@@ -786,8 +785,6 @@ INTERDIFF: rejected hunk from patch2, cannot diff context
 	bool notify;
 	int drops;
 
-	if (n == 0 && len == 0)
-		return;
 	drops = max_t(int, n, 0);
 	rcu_read_lock();
 	while ((parentid = sch->parent)) {
@@ -784,7 +784,7 @@
 		/* Notify parent qdisc only if child qdisc becomes empty. */
 		notify = !sch->q.qlen;
 		/* TODO: perform the search on a per txq basis */
-		sch = qdisc_lookup_rcu(qdisc_dev(sch), TC_H_MAJ(parentid));
+		sch = qdisc_lookup(qdisc_dev(sch), TC_H_MAJ(parentid));
 		if (sch == NULL) {
 		}
 		cops = sch->ops->cl_ops;
  • ⚠️ PR commit 0a7465a1c848 (net_sched: sch_ets: implement lockless ets_dump()) → upstream c5f1dde7f731
    Differences found:
diff -u b/net/sched/sch_ets.c b/net/sched/sch_ets.c
--- b/net/sched/sch_ets.c
+++ b/net/sched/sch_ets.c
@@ -696,3 +696,3 @@
 		q->classes[i].deficit = 0;
-		gnet_stats_basic_sync_init(&q->classes[i].bstats);
+		memset(&q->classes[i].bstats, 0, sizeof(q->classes[i].bstats));
 		memset(&q->classes[i].qstats, 0, sizeof(q->classes[i].qstats));

This is an automated interdiff check for backported commits.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/20752688195

@roxanan1996 roxanan1996 requested a review from a team January 6, 2026 15:20
Copy link
Collaborator

@bmastbergen bmastbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@bmastbergen bmastbergen requested a review from a team January 7, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants