Message ID | 20210930212239.3430364-1-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 560ee196fe9e5037e5015e2cdb14b3aecb1cd7dc |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net_sched: fix NULL deref in fifo_set_limit() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | fail | 2 blamed authors not CCed: kaber@trash.net shemminger@vyatta.com; 5 maintainers not CCed: jiri@resnulli.us jhs@mojatatu.com xiyou.wangcong@gmail.com kaber@trash.net shemminger@vyatta.com |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 35 this patch: 35 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | warning | WARNING: Possible repeated word: 'Google' |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 28 this patch: 28 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Thu, 30 Sep 2021 14:22:39 -0700 you wrote: > From: Eric Dumazet <edumazet@google.com> > > syzbot reported another NULL deref in fifo_set_limit() [1] > > I could repro the issue with : > > unshare -n > tc qd add dev lo root handle 1:0 tbf limit 200000 burst 70000 rate 100Mbit > tc qd replace dev lo parent 1:0 pfifo_fast > tc qd change dev lo root handle 1:0 tbf limit 300000 burst 70000 rate 100Mbit > > [...] Here is the summary with links: - [net] net_sched: fix NULL deref in fifo_set_limit() https://git.kernel.org/netdev/net/c/560ee196fe9e You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c index a579a4131d22d771c9766f5ad6cdb16ece3034c0..e1040421b79797fefaa26b8d7d3f44b91896e1de 100644 --- a/net/sched/sch_fifo.c +++ b/net/sched/sch_fifo.c @@ -233,6 +233,9 @@ int fifo_set_limit(struct Qdisc *q, unsigned int limit) if (strncmp(q->ops->id + 1, "fifo", 4) != 0) return 0; + if (!q->ops->change) + return 0; + nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL); if (nla) { nla->nla_type = RTM_NEWQDISC;