OSDN Git Service

selftests/landlock: Add hostfs tests
authorMickaël Salaün <mic@digikod.net>
Mon, 12 Jun 2023 19:14:30 +0000 (21:14 +0200)
committerMickaël Salaün <mic@digikod.net>
Mon, 12 Jun 2023 19:26:23 +0000 (21:26 +0200)
commit35ca4239929737bdc021ee923f97ebe7aff8fcc4
treeeac47ae574d943b0cfbf95238ce960a4bb241789
parent04f9070e99a4c5d60f05436f63e470c19b579e24
selftests/landlock: Add hostfs tests

Add tests for the hostfs filesystems to make sure it has a consistent
inode management, which is required for Landlock's file hierarchy
identification.  This adds 5 new tests for layout3_fs with the hostfs
variant.

Add hostfs to the new (architecture-specific) config.um file.

The hostfs filesystem, only available for an User-Mode Linux kernel, is
special because we cannot explicitly mount it.  The layout3_fs.hostfs
variant tests are skipped if the current test directory is not backed by
this filesystem.

The layout3_fs.hostfs.tag_inode_dir_child and
layout3_fs.hostfs.tag_inode_file tests pass thanks to a previous commit
fixing hostfs inode management.  Without this fix, the deny-by-default
policy would apply and all access requests would be denied.

Link: https://lore.kernel.org/r/20230612191430.339153-7-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
tools/testing/selftests/landlock/config.um [new file with mode: 0644]
tools/testing/selftests/landlock/fs_test.c