]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests/landlock: Test that MPTCP actions are not restricted
authorMikhail Ivanov <ivanov.mikhail1@huawei-partners.com>
Wed, 5 Feb 2025 09:36:51 +0000 (17:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2025 17:25:43 +0000 (18:25 +0100)
commit 3d4033985ff508ef587ca11f1c8361ba57c7e09f upstream.

Extend protocol fixture with test suits for MPTCP protocol.
Add CONFIG_MPTCP and CONFIG_MPTCP_IPV6 options in config.

Signed-off-by: Mikhail Ivanov <ivanov.mikhail1@huawei-partners.com>
Link: https://lore.kernel.org/r/20250205093651.1424339-4-ivanov.mikhail1@huawei-partners.com
Cc: <stable@vger.kernel.org> # 6.7.x
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/landlock/config
tools/testing/selftests/landlock/net_test.c

index 29af19c4e9f981923e231112efb5b4cf08dce3b4..a8982da4acbdc3dab3e2ec5692b991c72a1ae78c 100644 (file)
@@ -3,6 +3,8 @@ CONFIG_CGROUP_SCHED=y
 CONFIG_INET=y
 CONFIG_IPV6=y
 CONFIG_KEYS=y
+CONFIG_MPTCP=y
+CONFIG_MPTCP_IPV6=y
 CONFIG_NET=y
 CONFIG_NET_NS=y
 CONFIG_OVERLAY_FS=y
index 4e0aeb53b225a546134ef7068391e935fcefaf1b..f0f697af13ee8a1a13a56a26e552a686a25f2864 100644 (file)
@@ -309,6 +309,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_tcp) {
        },
 };
 
+/* clang-format off */
+FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_mptcp) {
+       /* clang-format on */
+       .sandbox = NO_SANDBOX,
+       .prot = {
+               .domain = AF_INET,
+               .type = SOCK_STREAM,
+               .protocol = IPPROTO_MPTCP,
+       },
+};
+
 /* clang-format off */
 FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_udp) {
        /* clang-format on */
@@ -329,6 +340,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_udp) {
        },
 };
 
+/* clang-format off */
+FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_mptcp) {
+       /* clang-format on */
+       .sandbox = NO_SANDBOX,
+       .prot = {
+               .domain = AF_INET6,
+               .type = SOCK_STREAM,
+               .protocol = IPPROTO_MPTCP,
+       },
+};
+
 /* clang-format off */
 FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_unix_stream) {
        /* clang-format on */
@@ -389,6 +411,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_udp) {
        },
 };
 
+/* clang-format off */
+FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_mptcp) {
+       /* clang-format on */
+       .sandbox = TCP_SANDBOX,
+       .prot = {
+               .domain = AF_INET,
+               .type = SOCK_STREAM,
+               .protocol = IPPROTO_MPTCP,
+       },
+};
+
 /* clang-format off */
 FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_unix_stream) {
        /* clang-format on */
@@ -399,6 +432,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_unix_stream) {
        },
 };
 
+/* clang-format off */
+FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_mptcp) {
+       /* clang-format on */
+       .sandbox = TCP_SANDBOX,
+       .prot = {
+               .domain = AF_INET6,
+               .type = SOCK_STREAM,
+               .protocol = IPPROTO_MPTCP,
+       },
+};
+
 /* clang-format off */
 FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_unix_datagram) {
        /* clang-format on */