linux-stable/net/openvswitch
Aaron Conole 65ded4eb22 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 09:12:30 +01:00
..
Kconfig
Makefile openvswitch: add trace points 2021-06-22 10:47:32 -07:00
actions.c net: openvswitch: fix race on port output 2023-04-20 12:35:09 +02:00
conntrack.c net/sched: act_ct: Always fill offloading tuple iifidx 2024-01-10 17:10:36 +01:00
conntrack.h net/sched: act_api: fix miss set post_ct for ovs after do conntrack in act_ct 2021-03-16 15:22:18 -07:00
datapath.c net: openvswitch: reject negative ifindex 2023-08-23 17:52:35 +02:00
datapath.h net/sched: Enable tc skb ext allocation on chain miss only when needed 2022-02-05 10:12:53 +00:00
dp_notify.c
flow.c net: openvswitch: fix parsing of nw_proto for IPv6 fragments 2022-06-23 11:44:01 +02:00
flow.h net: openvswitch: IPv6: Add IPv6 extension header support 2022-02-25 10:32:55 +00:00
flow_netlink.c net: openvswitch: limit the number of recursions from action sets 2024-02-23 09:12:30 +01:00
flow_netlink.h
flow_table.c openvswitch: Optimize operation for key comparison 2021-07-01 11:13:10 -07:00
flow_table.h net: openvswitch: fix to make sure flow_lookup() is not preempted 2020-10-18 12:29:36 -07:00
meter.c net: openvswitch: fix possible memory leak in ovs_meter_cmd_set() 2023-02-22 12:59:52 +01:00
meter.h
openvswitch_trace.c openvswitch: add trace points 2021-06-22 10:47:32 -07:00
openvswitch_trace.h openvswitch: add trace points 2021-06-22 10:47:32 -07:00
vport-geneve.c
vport-gre.c
vport-internal_dev.c openvswitch: Change the return type for vport_ops.send function hook to int 2022-09-19 18:28:50 -07:00
vport-internal_dev.h
vport-netdev.c net: rename reference+tracking helpers 2022-06-09 21:52:55 -07:00
vport-netdev.h
vport-vxlan.c
vport.c net: Add skb_clear_tstamp() to keep the mono delivery_time 2022-03-03 14:38:48 +00:00
vport.h openvswitch: Change the return type for vport_ops.send function hook to int 2022-09-19 18:28:50 -07:00