]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/sched: fix use-after-free in taprio_dev_notifier
authorHyunwoo Kim <imv4bel@gmail.com>
Sat, 14 Jun 2025 00:54:57 +0000 (20:54 -0400)
committerJakub Kicinski <kuba@kernel.org>
Tue, 17 Jun 2025 23:14:04 +0000 (16:14 -0700)
commitb160766e26d4e2e2d6fe2294e0b02f92baefcec5
tree55f1862608c1e82a56e6ba24cb01898c2eb1158f
parent4300fd62daf219e712687fff82098490517d6b20
net/sched: fix use-after-free in taprio_dev_notifier

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: fed87cc6718a ("net/sched: taprio: automatically calculate queueMaxSDU based on TC gate durations")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/aEzIYYxt0is9upYG@v4bel-B760M-AORUS-ELITE-AX
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_taprio.c