Skip to content

Commit a913c2d

Browse files
sm1ling-knightgregkh
authored andcommitted
selftests/landlock: Test that MPTCP actions are not restricted
commit 3d40339 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> # 6.7.x Signed-off-by: Mickaël Salaün <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ebb0c0f commit a913c2d

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

tools/testing/selftests/landlock/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ CONFIG_CGROUP_SCHED=y
33
CONFIG_INET=y
44
CONFIG_IPV6=y
55
CONFIG_KEYS=y
6+
CONFIG_MPTCP=y
7+
CONFIG_MPTCP_IPV6=y
68
CONFIG_NET=y
79
CONFIG_NET_NS=y
810
CONFIG_OVERLAY_FS=y

tools/testing/selftests/landlock/net_test.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_tcp) {
309309
},
310310
};
311311

312+
/* clang-format off */
313+
FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_mptcp) {
314+
/* clang-format on */
315+
.sandbox = NO_SANDBOX,
316+
.prot = {
317+
.domain = AF_INET,
318+
.type = SOCK_STREAM,
319+
.protocol = IPPROTO_MPTCP,
320+
},
321+
};
322+
312323
/* clang-format off */
313324
FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_udp) {
314325
/* clang-format on */
@@ -329,6 +340,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_udp) {
329340
},
330341
};
331342

343+
/* clang-format off */
344+
FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_mptcp) {
345+
/* clang-format on */
346+
.sandbox = NO_SANDBOX,
347+
.prot = {
348+
.domain = AF_INET6,
349+
.type = SOCK_STREAM,
350+
.protocol = IPPROTO_MPTCP,
351+
},
352+
};
353+
332354
/* clang-format off */
333355
FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_unix_stream) {
334356
/* clang-format on */
@@ -389,6 +411,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_udp) {
389411
},
390412
};
391413

414+
/* clang-format off */
415+
FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_mptcp) {
416+
/* clang-format on */
417+
.sandbox = TCP_SANDBOX,
418+
.prot = {
419+
.domain = AF_INET,
420+
.type = SOCK_STREAM,
421+
.protocol = IPPROTO_MPTCP,
422+
},
423+
};
424+
392425
/* clang-format off */
393426
FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_unix_stream) {
394427
/* clang-format on */
@@ -399,6 +432,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_unix_stream) {
399432
},
400433
};
401434

435+
/* clang-format off */
436+
FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_mptcp) {
437+
/* clang-format on */
438+
.sandbox = TCP_SANDBOX,
439+
.prot = {
440+
.domain = AF_INET6,
441+
.type = SOCK_STREAM,
442+
.protocol = IPPROTO_MPTCP,
443+
},
444+
};
445+
402446
/* clang-format off */
403447
FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_unix_datagram) {
404448
/* clang-format on */

0 commit comments

Comments
 (0)