diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-09-30 23:49:21 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-09-30 23:49:21 +0200 |
commit | dd9a887b35b01d7027f974f5e7936f1410ab51ca (patch) | |
tree | 4a827b3e88fd896de1408c26ebebc2535b14750a /net/sched/sch_api.c | |
parent | Merge branch 'snmp-optimizations' (diff) | |
parent | Merge tag 'net-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff) | |
download | linux-dd9a887b35b01d7027f974f5e7936f1410ab51ca.tar.xz linux-dd9a887b35b01d7027f974f5e7936f1410ab51ca.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
drivers/net/phy/bcm7xxx.c
d88fd1b546ff ("net: phy: bcm7xxx: Fixed indirect MMD operations")
f68d08c437f9 ("net: phy: bcm7xxx: Add EPHY entry for 72165")
net/sched/sch_api.c
b193e15ac69d ("net: prevent user from passing illegal stab size")
69508d43334e ("net_sched: Use struct_size() and flex_array_size() helpers")
Both cases trivial - adjacent code additions.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index e1a40d3b1ed0..91820f67275c 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -514,6 +514,12 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt, return stab; } + if (s->size_log > STAB_SIZE_LOG_MAX || + s->cell_log > STAB_SIZE_LOG_MAX) { + NL_SET_ERR_MSG(extack, "Invalid logarithmic size of size table"); + return ERR_PTR(-EINVAL); + } + stab = kmalloc(struct_size(stab, data, tsize), GFP_KERNEL); if (!stab) return ERR_PTR(-ENOMEM); |