selftests/landlock: Test ftruncate on FDs created by memfd_create(2)
authorGünther Noack <gnoack3000@gmail.com>
Tue, 18 Oct 2022 18:22:14 +0000 (20:22 +0200)
committerMickaël Salaün <mic@digikod.net>
Wed, 19 Oct 2022 07:01:47 +0000 (09:01 +0200)
commit0d8c658be264eb2106349c50377ef8a81edc0106
treeb4551346be295e0cc68d5c31cdba5a9528b0f216
parenta1a202a581817312a02b4d0daa6ca16f701f1e8a
selftests/landlock: Test ftruncate on FDs created by memfd_create(2)

All file descriptors that are truncatable need to have the Landlock
access rights set correctly on the file's Landlock security blob. This
is also the case for files that are opened by other means than
open(2).

Test coverage for security/landlock is 94.7% of 838 lines according to
gcc/gcov-11.

Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Link: https://lore.kernel.org/r/20221018182216.301684-10-gnoack3000@gmail.com
[mic: Add test coverage in commit message]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
tools/testing/selftests/landlock/fs_test.c