Message ID | 20230109163906.706000-1-fred@cloudflare.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 96398560f26aa07e8f2969d73c8197e6a6d10407 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: sched: disallow noqueue for qdisc classes | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net |
netdev/fixes_present | success | Fixes tag present in non-next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Single patches do not need cover letters |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 3 this patch: 3 |
netdev/cc_maintainers | success | CCed 9 of 9 maintainers |
netdev/build_clang | success | Errors and warnings before: 1 this patch: 1 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | Fixes tag looks correct |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 3 this patch: 3 |
netdev/checkpatch | warning | WARNING: line length of 83 exceeds 80 columns |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
Hello: This patch was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: On Mon, 9 Jan 2023 10:39:06 -0600 you wrote: > While experimenting with applying noqueue to a classful queue discipline, > we discovered a NULL pointer dereference in the __dev_queue_xmit() > path that generates a kernel OOPS: > > # dev=enp0s5 > # tc qdisc replace dev $dev root handle 1: htb default 1 > # tc class add dev $dev parent 1: classid 1:1 htb rate 10mbit > # tc qdisc add dev $dev parent 1:1 handle 10: noqueue > # ping -I $dev -w 1 -c 1 1.1.1.1 > > [...] Here is the summary with links: - [net] net: sched: disallow noqueue for qdisc classes https://git.kernel.org/netdev/net/c/96398560f26a You are awesome, thank you!
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 2317db02c764..72d2c204d5f3 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1133,6 +1133,11 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, return -ENOENT; } + if (new && new->ops == &noqueue_qdisc_ops) { + NL_SET_ERR_MSG(extack, "Cannot assign noqueue to a class"); + return -EINVAL; + } + err = cops->graft(parent, cl, new, &old, extack); if (err) return err;