Skip to content

Commit bb77f6f

Browse files
pvts-matPlaidCat
authored andcommitted
net/sched: fix use-after-free in taprio_dev_notifier
jira VULN-71604 cve CVE-2025-38087 commit-author Hyunwoo Kim <[email protected]> commit b160766 Since taprio’s taprio_dev_notifier() isn’t protected by an RCU read-side critical section, a race with advance_sched() can lead to a use-after-free. Adding rcu_read_lock() inside taprio_dev_notifier() prevents this. Fixes: fed87cc ("net/sched: taprio: automatically calculate queueMaxSDU based on TC gate durations") Cc: [email protected] Signed-off-by: Hyunwoo Kim <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/aEzIYYxt0is9upYG@v4bel-B760M-AORUS-ELITE-AX Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit b160766) Signed-off-by: Marcin Wcisło <[email protected]>
1 parent 7075a24 commit bb77f6f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/sched/sch_taprio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,13 +1340,15 @@ static int taprio_dev_notifier(struct notifier_block *nb, unsigned long event,
13401340

13411341
stab = rtnl_dereference(q->root->stab);
13421342

1343-
oper = rtnl_dereference(q->oper_sched);
1343+
rcu_read_lock();
1344+
oper = rcu_dereference(q->oper_sched);
13441345
if (oper)
13451346
taprio_update_queue_max_sdu(q, oper, stab);
13461347

1347-
admin = rtnl_dereference(q->admin_sched);
1348+
admin = rcu_dereference(q->admin_sched);
13481349
if (admin)
13491350
taprio_update_queue_max_sdu(q, admin, stab);
1351+
rcu_read_unlock();
13501352

13511353
break;
13521354
}

0 commit comments

Comments
 (0)