Skip to content

Commit c9cbfbd

Browse files
author
Herton R. Krzesinski
committed
Merge: net: sched: fix race condition in qdisc_graft()
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2023 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2165745 CVE: CVE-2023-0590 Upstream Status: net.git commit ebda44d Tested: boot-tested only Conflicts: none Signed-off-by: Davide Caratti <dcaratti@redhat.com> Approved-by: Guillaume Nault <gnault@redhat.com> Approved-by: Paolo Abeni <pabeni@redhat.com> Approved-by: Hangbin Liu <haliu@redhat.com> Approved-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents 7b502e8 + c6f1e3b commit c9cbfbd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/sched/sch_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,12 +1081,13 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
10811081

10821082
skip:
10831083
if (!ingress) {
1084-
notify_and_destroy(net, skb, n, classid,
1085-
rtnl_dereference(dev->qdisc), new);
1084+
old = rtnl_dereference(dev->qdisc);
10861085
if (new && !new->ops->attach)
10871086
qdisc_refcount_inc(new);
10881087
rcu_assign_pointer(dev->qdisc, new ? : &noop_qdisc);
10891088

1089+
notify_and_destroy(net, skb, n, classid, old, new);
1090+
10901091
if (new && new->ops->attach)
10911092
new->ops->attach(new);
10921093
} else {

0 commit comments

Comments
 (0)