]> git.itanic.dy.fi Git - linux-stable/commit
Merge branch 'net-openvswitch-limit-the-recursions-from-action-sets'
authorJakub Kicinski <kuba@kernel.org>
Fri, 9 Feb 2024 20:54:39 +0000 (12:54 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Feb 2024 20:54:40 +0000 (12:54 -0800)
commit6a12401b65a5ba57cfe1361c9a3e054ffde68611
tree0e9bc6fb2090518ce781dacda64018b89ffe8984
parentd02bfae3646a679ed8ca0660d12336ef54d44817
parentbd128f62c365504e1268dc09fcccdfb1f091e93a
Merge branch 'net-openvswitch-limit-the-recursions-from-action-sets'

Aaron Conole says:

====================
net: openvswitch: limit the recursions from action sets

Open vSwitch module accepts actions as a list from the netlink socket
and then creates a copy which it uses in the action set processing.
During processing of the action list on a packet, the module keeps a
count of the execution depth and exits processing if the action depth
goes too high.

However, during netlink processing the recursion depth isn't checked
anywhere, and the copy trusts that kernel has large enough stack to
accommodate it.  The OVS sample action was the original action which
could perform this kinds of recursion, and it originally checked that
it didn't exceed the sample depth limit.  However, when sample became
optimized to provide the clone() semantics, the recursion limit was
dropped.

This series adds a depth limit during the __ovs_nla_copy_actions() call
that will ensure we don't exceed the max that the OVS userspace could
generate for a clone().

Additionally, this series provides a selftest in 2/2 that can be used to
determine if the OVS module is allowing unbounded access.  It can be
safely omitted where the ovs selftest framework isn't available.
====================

Link: https://lore.kernel.org/r/20240207132416.1488485-1-aconole@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>