diff mbox series

[net-next] net: sched: don't set tunnel for decap action

Message ID 20190401111659.22588-1-vladbu@mellanox.com
State Accepted
Delegated to: David Miller
Headers show
Series [net-next] net: sched: don't set tunnel for decap action | expand

Commit Message

Vlad Buslov April 1, 2019, 11:16 a.m. UTC
Action tunnel_key doesn't have a metadata/tunnel for release(decap) action.
Drivers do not dereference entry->tunnel pointer for that action type, so
this behavior doesn't result in a crash at the moment. However, this needs
to be corrected as a preparation for updating hardware offloads API to not
rely on rtnl lock, for which flow_action code will copy the tunnel data to
temporary buffer to prevent concurrent action overwrite from
invalidating/freeing it.

Fixes: 3a7b68617de7 ("cls_api: add translator to flow_action representation")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
---
 net/sched/cls_api.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Miller April 2, 2019, 8:20 p.m. UTC | #1
From: Vlad Buslov <vladbu@mellanox.com>
Date: Mon,  1 Apr 2019 14:16:59 +0300

> Action tunnel_key doesn't have a metadata/tunnel for release(decap) action.
> Drivers do not dereference entry->tunnel pointer for that action type, so
> this behavior doesn't result in a crash at the moment. However, this needs
> to be corrected as a preparation for updating hardware offloads API to not
> rely on rtnl lock, for which flow_action code will copy the tunnel data to
> temporary buffer to prevent concurrent action overwrite from
> invalidating/freeing it.
> 
> Fixes: 3a7b68617de7 ("cls_api: add translator to flow_action representation")
> Signed-off-by: Vlad Buslov <vladbu@mellanox.com>

Applied, thanks Vlad.
diff mbox series

Patch

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 99ae30c177c7..9115f053883f 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3229,7 +3229,6 @@  int tc_setup_flow_action(struct flow_action *flow_action,
 			entry->tunnel = tcf_tunnel_info(act);
 		} else if (is_tcf_tunnel_release(act)) {
 			entry->id = FLOW_ACTION_TUNNEL_DECAP;
-			entry->tunnel = tcf_tunnel_info(act);
 		} else if (is_tcf_pedit(act)) {
 			for (k = 0; k < tcf_pedit_nkeys(act); k++) {
 				switch (tcf_pedit_cmd(act, k)) {