Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sched: don't set tunnel for decap action

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vlad Buslov and committed by
David S. Miller
3eed5284 40d0690b

-1
-1
net/sched/cls_api.c
··· 3229 3229 entry->tunnel = tcf_tunnel_info(act); 3230 3230 } else if (is_tcf_tunnel_release(act)) { 3231 3231 entry->id = FLOW_ACTION_TUNNEL_DECAP; 3232 - entry->tunnel = tcf_tunnel_info(act); 3233 3232 } else if (is_tcf_pedit(act)) { 3234 3233 for (k = 0; k < tcf_pedit_nkeys(act); k++) { 3235 3234 switch (tcf_pedit_cmd(act, k)) {