add missing validation of 'skip_hw/skip_sw'
Subsystems (3)
cover add missing validation of 'skip_hw/skip_sw'
ensure that all classifiers currently supporting HW offload validate the 'flags' parameter provided by user:
- patch 1/2 fixes cls_matchall
- patch 2/2 fixes cls_flower
Davide Caratti (2):
net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS net/sched: flower: add missing validation of TCA_FLOWER_FLAGS
net/sched/cls_flower.c | 1 + net/sched/cls_matchall.c | 1 + 2 files changed, 2 insertions(+)
Signature · 1 line
2.24.1
PATCH 1/2 net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS
unlike other classifiers that can be offloaded (i.e. users can set flags like 'skip_hw' and 'skip_sw'), 'cls_matchall' doesn't validate the size of netlink attribute 'TCA_MATCHALL_FLAGS' provided by user: add a proper entry to mall_policy.
--- net/sched/cls_matchall.c | 1 + 1 file changed, 1 insertion(+)
net/sched/cls_matchall.c +1 -0
@@ -157,6 +157,7 @@ static void *mall_get(struct tcf_proto *tp, u32 handle)static const struct nla_policy mall_policy[TCA_MATCHALL_MAX +1 ] = { [TCA_MATCHALL_UNSPEC ] = { .type =NLA_UNSPEC }, [TCA_MATCHALL_CLASSID ] = { .type =NLA_U32 }, + [TCA_MATCHALL_FLAGS ] = { .type =NLA_U32 }, }; static int mall_set_parms(struct net *net, struct tcf_proto *tp,
Signature · 1 line
2.24.1
PATCH 2/2 net/sched: flower: add missing validation of TCA_FLOWER_FLAGS
In reply to Davide Carattiunlike other classifiers that can be offloaded (i.e. users can set flags like 'skip_hw' and 'skip_sw'), 'cls_flower' doesn't validate the size of netlink attribute 'TCA_FLOWER_FLAGS' provided by user: add a proper entry to fl_policy.
--- net/sched/cls_flower.c | 1 + 1 file changed, 1 insertion(+)
net/sched/cls_flower.c +1 -0
@@ -691,6 +691,7 @@ static const struct nla_policy fl_policy[TCA_FLOWER_MAX + 1] = { .len = 128 / BITS_PER_BYTE }, [TCA_FLOWER_KEY_CT_LABELS_MASK] = { .type = NLA_BINARY, .len = 128 / BITS_PER_BYTE }, + [TCA_FLOWER_FLAGS] = { .type = NLA_U32 }, }; static const struct nla_policy
Signature · 1 line
2.24.1
Re: [PATCH net 1/2] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS
In reply to Davide CarattiQuoted 7 lines · Tue, Feb 11, 2020 at 07:33:39PM CET, [email protected] wrote:
unlike other classifiers that can be offloaded (i.e. users can set flags like '
skip_hw' and 'skip_sw'), 'cls_matchall' doesn't validate the size of netlink attribute 'TCA_MATCHALL_FLAGS' provided by user: add a proper entry tomall_policy.Fixes b87f7936a932 ("net/sched: Add match-all classifier hw offloading.")Signed-off-by Davide Caratti <[email protected]>
I was actually about to send these :)
Thanks
Re: [PATCH net 2/2] net/sched: flower: add missing validation of TCA_FLOWER_FLAGS
In reply to Davide CarattiQuoted 7 lines · Tue, Feb 11, 2020 at 07:33:40PM CET, [email protected] wrote:
unlike other classifiers that can be offloaded (i.e. users can set flags like '
skip_hw' and 'skip_sw'), 'cls_flower' doesn't validate the size of netlink attribute 'TCA_FLOWER_FLAGS' provided by user: add a proper entry tofl_policy.Fixes 5b33f48842fa ("net/flower: Introduce hardware offload support")Signed-off-by Davide Caratti <[email protected]>
David Miller
maintainerFrom: Davide Caratti <[email protected]>
Date: Tue, 11 Feb 2020 19:33:38 +0100
Quoted 5 lines
ensure that all classifiers currently supporting HW offload validate the 'flags' parameter provided by user:
- patch 1/2 fixes
cls_matchall
- patch 2/2 fixescls_flower
Series applied and queued up for -stable, thanks.