Skip to content

Commit 3d40339

Browse files
sm1ling-knightl0kod
authored andcommitted
selftests/landlock: Test that MPTCP actions are not restricted
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>
1 parent f5534d5 commit 3d40339

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
@@ -4,6 +4,8 @@ CONFIG_CGROUP_SCHED=y
44
CONFIG_INET=y
55
CONFIG_IPV6=y
66
CONFIG_KEYS=y
7+
CONFIG_MPTCP=y
8+
CONFIG_MPTCP_IPV6=y
79
CONFIG_NET=y
810
CONFIG_NET_NS=y
911
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
@@ -312,6 +312,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_tcp2) {
312312
},
313313
};
314314

315+
/* clang-format off */
316+
FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_mptcp) {
317+
/* clang-format on */
318+
.sandbox = NO_SANDBOX,
319+
.prot = {
320+
.domain = AF_INET,
321+
.type = SOCK_STREAM,
322+
.protocol = IPPROTO_MPTCP,
323+
},
324+
};
325+
315326
/* clang-format off */
316327
FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_tcp1) {
317328
/* clang-format on */
@@ -335,6 +346,17 @@ FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_tcp2) {
335346
},
336347
};
337348

349+
/* clang-format off */
350+
FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv6_mptcp) {
351+
/* clang-format on */
352+
.sandbox = NO_SANDBOX,
353+
.prot = {
354+
.domain = AF_INET6,
355+
.type = SOCK_STREAM,
356+
.protocol = IPPROTO_MPTCP,
357+
},
358+
};
359+
338360
/* clang-format off */
339361
FIXTURE_VARIANT_ADD(protocol, no_sandbox_with_ipv4_udp) {
340362
/* clang-format on */
@@ -398,6 +420,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_tcp2) {
398420
},
399421
};
400422

423+
/* clang-format off */
424+
FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_mptcp) {
425+
/* clang-format on */
426+
.sandbox = TCP_SANDBOX,
427+
.prot = {
428+
.domain = AF_INET,
429+
.type = SOCK_STREAM,
430+
.protocol = IPPROTO_MPTCP,
431+
},
432+
};
433+
401434
/* clang-format off */
402435
FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_tcp1) {
403436
/* clang-format on */
@@ -421,6 +454,17 @@ FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_tcp2) {
421454
},
422455
};
423456

457+
/* clang-format off */
458+
FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv6_mptcp) {
459+
/* clang-format on */
460+
.sandbox = TCP_SANDBOX,
461+
.prot = {
462+
.domain = AF_INET6,
463+
.type = SOCK_STREAM,
464+
.protocol = IPPROTO_MPTCP,
465+
},
466+
};
467+
424468
/* clang-format off */
425469
FIXTURE_VARIANT_ADD(protocol, tcp_sandbox_with_ipv4_udp) {
426470
/* clang-format on */

0 commit comments

Comments
 (0)