Skip to content

Minor Landlock fixes and new tests

Mickaël Salaün linux-api linux-security-module lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 0 repliesNew
  2. v17 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10landlock: Fix landlock_add_rule(2) documentationinclude/uapi/linux/landlock.h security/landlock/syscalls.c+6 -60 replies
2/10selftests/landlock: Make tests build with old libctools/testing/selftests/landlock/fs_test.c+18 -50 replies
3/10selftests/landlock: Extend tests for minimal valid attribute sizetools/testing/selftests/landlock/base_test.c+5 -00 replies
4/10selftests/landlock: Add tests for unknown access rightstools/testing/selftests/landlock/fs_test.c+16 -00 replies
5/10selftests/landlock: Extend access right tests to directoriestools/testing/selftests/landlock/fs_test.c+22 -80 replies
6/10selftests/landlock: Fully test file rename with "remove" accesstools/testing/selftests/landlock/fs_test.c+37 -40 replies
7/10selftests/landlock: Add tests for O_PATHtools/testing/selftests/landlock/fs_test.c+8 -20 replies
8/10landlock: Change landlock_add_rule(2) argument check orderingsecurity/landlock/syscalls.c tools/testing/selftests/landlock/base_test.c+45 -110 replies
9/10landlock: Change landlock_restrict_self(2) check orderingsecurity/landlock/syscalls.c tools/testing/selftests/landlock/base_test.c+41 -140 replies
10/10selftests/landlock: Test landlock_create_ruleset(2) argument check orderingtools/testing/selftests/landlock/base_test.c+20 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/10] Minor Landlock fixes and new tests

Hi,

This series contains some minor code and documentation fixes. There is also some miscellaneous new tests to improve coverage and that may help for future access types (e.g. networking).

The important new patches are the last three ones. They change the landlock_add_rule(2) and landlock_restrict_self(2) check orderings to make them more consistent according to future Landlock rule types (e.g. networking).

As suggested by Alejandro Colomar [1], I removed the landlock_add_rule(2) signature fix. I added a new patch to test O_PATH behavior.

Test coverage for security/landlock was 94.4% of 500 lines, and it is now 94.4% of 504 lines according to gcc/gcov-11.

I also fixed some typos and formatted the code with clang-format. This series can be applied on top of
https://lore.kernel.org/r/[email protected]

[1] https://lore.kernel.org/r/[email protected]

Previous version:
https://lore.kernel.org/r/[email protected]

Regards,

Mickaël Salaün (10):
landlock: Fix landlock_add_rule(2) documentation selftests/landlock: Make tests build with old libc selftests/landlock: Extend tests for minimal valid attribute size selftests/landlock: Add tests for unknown access rights selftests/landlock: Extend access right tests to directories selftests/landlock: Fully test file rename with "remove" access selftests/landlock: Add tests for O_PATH
landlock: Change landlock_add_rule(2) argument check ordering
landlock: Change landlock_restrict_self(2) check ordering selftests/landlock: Test landlock_create_ruleset(2) argument check
ordering

 include/uapi/linux/landlock.h                |   5 +-
 security/landlock/syscalls.c                 |  37 +++---
 tools/testing/selftests/landlock/base_test.c | 107 +++++++++++++++--
 tools/testing/selftests/landlock/fs_test.c   | 120 ++++++++++++++++---
 4 files changed, 218 insertions(+), 51 deletions(-)

base-commit: 763c5dc0e990fbd803c3c2b1ae832366ab7d207f

Signature · 1 line
2.35.1