All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw'
@ 2020-02-11 18:33 Davide Caratti
  2020-02-11 18:33 ` [PATCH net 1/2] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS Davide Caratti
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Davide Caratti @ 2020-02-11 18:33 UTC (permalink / raw)
  To: Amir Vadai, Yotam Gigi, Jiri Pirko, David S. Miller; +Cc: netdev

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(+)

-- 
2.24.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net 1/2] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS
  2020-02-11 18:33 [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw' Davide Caratti
@ 2020-02-11 18:33 ` Davide Caratti
  2020-02-12  7:28   ` Jiri Pirko
  2020-02-11 18:33 ` [PATCH net 2/2] net/sched: flower: add missing validation of TCA_FLOWER_FLAGS Davide Caratti
  2020-02-13 22:17 ` [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw' David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Davide Caratti @ 2020-02-11 18:33 UTC (permalink / raw)
  To: Amir Vadai, Yotam Gigi, Jiri Pirko, David S. Miller; +Cc: netdev

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.

Fixes: b87f7936a932 ("net/sched: Add match-all classifier hw offloading.")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
 net/sched/cls_matchall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index 039cc86974f4..610a0b728161 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -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,
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net 2/2] net/sched: flower: add missing validation of TCA_FLOWER_FLAGS
  2020-02-11 18:33 [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw' Davide Caratti
  2020-02-11 18:33 ` [PATCH net 1/2] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS Davide Caratti
@ 2020-02-11 18:33 ` Davide Caratti
  2020-02-12  7:28   ` Jiri Pirko
  2020-02-13 22:17 ` [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw' David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Davide Caratti @ 2020-02-11 18:33 UTC (permalink / raw)
  To: Amir Vadai, Yotam Gigi, Jiri Pirko, David S. Miller; +Cc: netdev

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
to fl_policy.

Fixes: 5b33f48842fa ("net/flower: Introduce hardware offload support")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
 net/sched/cls_flower.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index f9c0d1e8d380..7e54d2ab5254 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -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
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net 1/2] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS
  2020-02-11 18:33 ` [PATCH net 1/2] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS Davide Caratti
@ 2020-02-12  7:28   ` Jiri Pirko
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2020-02-12  7:28 UTC (permalink / raw)
  To: Davide Caratti
  Cc: Amir Vadai, Yotam Gigi, Jiri Pirko, David S. Miller, netdev

Tue, Feb 11, 2020 at 07:33:39PM CET, dcaratti@redhat.com 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 to mall_policy.
>
>Fixes: b87f7936a932 ("net/sched: Add match-all classifier hw offloading.")
>Signed-off-by: Davide Caratti <dcaratti@redhat.com>

I was actually about to send these :)
Thanks

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net 2/2] net/sched: flower: add missing validation of TCA_FLOWER_FLAGS
  2020-02-11 18:33 ` [PATCH net 2/2] net/sched: flower: add missing validation of TCA_FLOWER_FLAGS Davide Caratti
@ 2020-02-12  7:28   ` Jiri Pirko
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Pirko @ 2020-02-12  7:28 UTC (permalink / raw)
  To: Davide Caratti
  Cc: Amir Vadai, Yotam Gigi, Jiri Pirko, David S. Miller, netdev

Tue, Feb 11, 2020 at 07:33:40PM CET, dcaratti@redhat.com 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
>to fl_policy.
>
>Fixes: 5b33f48842fa ("net/flower: Introduce hardware offload support")
>Signed-off-by: Davide Caratti <dcaratti@redhat.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw'
  2020-02-11 18:33 [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw' Davide Caratti
  2020-02-11 18:33 ` [PATCH net 1/2] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS Davide Caratti
  2020-02-11 18:33 ` [PATCH net 2/2] net/sched: flower: add missing validation of TCA_FLOWER_FLAGS Davide Caratti
@ 2020-02-13 22:17 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-02-13 22:17 UTC (permalink / raw)
  To: dcaratti; +Cc: amir, yotamg, jiri, netdev

From: Davide Caratti <dcaratti@redhat.com>
Date: Tue, 11 Feb 2020 19:33:38 +0100

> 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

Series applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-13 22:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 18:33 [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw' Davide Caratti
2020-02-11 18:33 ` [PATCH net 1/2] net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS Davide Caratti
2020-02-12  7:28   ` Jiri Pirko
2020-02-11 18:33 ` [PATCH net 2/2] net/sched: flower: add missing validation of TCA_FLOWER_FLAGS Davide Caratti
2020-02-12  7:28   ` Jiri Pirko
2020-02-13 22:17 ` [PATCH net 0/2] add missing validation of 'skip_hw/skip_sw' David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.