All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: sched: don't set tunnel for decap action
@ 2019-04-01 11:16 Vlad Buslov
  2019-04-02 20:20 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vlad Buslov @ 2019-04-01 11:16 UTC (permalink / raw)
  To: netdev; +Cc: jhs, xiyou.wangcong, jiri, davem, Vlad Buslov

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

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)) {
-- 
2.21.0


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

* Re: [PATCH net-next] net: sched: don't set tunnel for decap action
  2019-04-01 11:16 [PATCH net-next] net: sched: don't set tunnel for decap action Vlad Buslov
@ 2019-04-02 20:20 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-04-02 20:20 UTC (permalink / raw)
  To: vladbu; +Cc: netdev, jhs, xiyou.wangcong, jiri

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.

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

end of thread, other threads:[~2019-04-02 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01 11:16 [PATCH net-next] net: sched: don't set tunnel for decap action Vlad Buslov
2019-04-02 20:20 ` 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.