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)
committerMickaël Salaün <mic@digikod.net>
Fri, 14 Feb 2025 08:23:10 +0000 (09:23 +0100)
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>
tools/testing/selftests/landlock/config
tools/testing/selftests/landlock/net_test.c

index 361f94f8cb0d48e3eb0db955f48ed867c1db479a..425de4c20271cae4e4e783b51b3d3abf6fa0089f 100644 (file)
@@ -4,6 +4,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 333263780fae40b923de646135fee8f4f2bb1468..d9de0ee49ebc270ddf5fabd6bfba2374bca50927 100644 (file)
@@ -312,6 +312,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_tcp2) {
        },
 };
 
+/* 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_ipv6_tcp1) {
        /* clang-format on */
@@ -335,6 +346,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_tcp2) {
        },
 };
 
+/* 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_ipv4_udp) {
        /* clang-format on */
@@ -398,6 +420,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_tcp2) {
        },
 };
 
+/* 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_ipv6_tcp1) {
        /* clang-format on */
@@ -421,6 +454,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_tcp2) {
        },
 };
 
+/* 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_ipv4_udp) {
        /* clang-format on */