[LTP] [RFC PATCH v1 1/1] splice07.c: Skip invalid splice() tests involving memfd secret
Jan Polensky
japo@linux.ibm.com
Wed Jul 9 18:30:22 CEST 2025
Linux commit cbe4134ea4bc ("fs: export anon_inode_make_secure_inode() and fix
secretmem LSM bypass") prevents any access to secret memory pages from other
kernel subsystems.
Splice operations involving memfd secret are no longer valid and return EACCES.
These test cases are skipped accordingly.
This avoids false negatives in splice07 test:
[skip]
splice07.c:54: TFAIL: splice() on pipe read end -> memfd secret expected EBADF, EINVAL: EACCES (13)
[skip]
splice07.c:54: TFAIL: splice() on memfd secret -> pipe write end expected EBADF, EINVAL: EACCES (13)
[skip]
Reference: cbe4134ea4bc ("fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass")
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---
testcases/kernel/syscalls/splice/splice07.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/testcases/kernel/syscalls/splice/splice07.c b/testcases/kernel/syscalls/splice/splice07.c
index 2228e2f269de..c750a14bf439 100644
--- a/testcases/kernel/syscalls/splice/splice07.c
+++ b/testcases/kernel/syscalls/splice/splice07.c
@@ -27,6 +27,7 @@ static void check_splice(struct tst_fd *fd_in, struct tst_fd *fd_out)
case TST_FD_UNIX_SOCK:
case TST_FD_INET_SOCK:
case TST_FD_MEMFD:
+ case TST_FD_MEMFD_SECRET:
return;
default:
break;
@@ -40,6 +41,7 @@ static void check_splice(struct tst_fd *fd_in, struct tst_fd *fd_out)
case TST_FD_FILE:
case TST_FD_PROC_MAPS:
case TST_FD_MEMFD:
+ case TST_FD_MEMFD_SECRET:
return;
/* And this complains about socket not being connected */
case TST_FD_INET_SOCK:
--
2.50.0
More information about the ltp
mailing list