linux-stable/net/openvswitch
Aaron Conole 55cfccb658 net: openvswitch: limit the number of recursions from action sets
[ Upstream commit 6e2f90d31f ]

The ovs module allows for some actions to recursively contain an action
list for complex scenarios, such as sampling, checking lengths, etc.
When these actions are copied into the internal flow table, they are
evaluated to validate that such actions make sense, and these calls
happen recursively.

The ovs-vswitchd userspace won't emit more than 16 recursion levels
deep.  However, the module has no such limit and will happily accept
limits larger than 16 levels nested.  Prevent this by tracking the
number of recursions happening and manually limiting it to 16 levels
nested.

The initial implementation of the sample action would track this depth
and prevent more than 3 levels of recursion, but this was removed to
support the clone use case, rather than limited at the current userspace
limit.

Fixes: 798c166173 ("openvswitch: Optimize sample action for the clone use cases")
Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240207132416.1488485-2-aconole@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 08:42:23 +01:00
..
actions.c net: openvswitch: fix misuse of the cached connection on tuple changes 2022-06-22 14:13:20 +02:00
conntrack.c netfilter: conntrack: Fix data-races around ct mark 2022-12-02 17:40:00 +01:00
conntrack.h
datapath.c net: openvswitch: fix flow memory leak in ovs_flow_cmd_new 2023-02-15 17:22:14 +01:00
datapath.h
dp_notify.c
flow.c net: openvswitch: fix parsing of nw_proto for IPv6 fragments 2022-06-29 08:59:45 +02:00
flow.h
flow_netlink.c net: openvswitch: limit the number of recursions from action sets 2024-02-23 08:42:23 +01:00
flow_netlink.h
flow_table.c
flow_table.h
Kconfig
Makefile
meter.c net: openvswitch: fix possible memory leak in ovs_meter_cmd_set() 2023-02-22 12:55:57 +01:00
meter.h
vport-geneve.c
vport-gre.c
vport-internal_dev.c
vport-internal_dev.h
vport-netdev.c
vport-netdev.h
vport-vxlan.c
vport.c ovs: clear skb->tstamp in forwarding path 2021-08-26 08:35:50 -04:00
vport.h