Skip to content

Commit b0dd222

Browse files
committed
net/sched: sch_hfsc: Ensure inner classes have fsc curve
jira VULN-6709 cve CVE-2023-4623 commit-author Budimir Markovic <[email protected]> commit b3d26c5 HFSC assumes that inner classes have an fsc curve, but it is currently possible for classes without an fsc curve to become parents. This leads to bugs including a use-after-free. Don't allow non-root classes without HFSC_FSC to become parents. Fixes: 1da177e ("Linux-2.6.12-rc2") Reported-by: Budimir Markovic <[email protected]> Signed-off-by: Budimir Markovic <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit b3d26c5) Signed-off-by: Marcin Wcisło <[email protected]>
1 parent 5d5ceb8 commit b0dd222

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/sched/sch_hfsc.c

+4
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,10 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
10121012
if (parent == NULL)
10131013
return -ENOENT;
10141014
}
1015+
if (!(parent->cl_flags & HFSC_FSC) && parent != &q->root) {
1016+
NL_SET_ERR_MSG(extack, "Invalid parent - parent class must have FSC");
1017+
return -EINVAL;
1018+
}
10151019

10161020
if (classid == 0 || TC_H_MAJ(classid ^ sch->handle) != 0)
10171021
return -EINVAL;

0 commit comments

Comments
 (0)