linux-yocto/security/landlock
Mickaël Salaün d617f0d72d
landlock: Optimize file path walks and prepare for audit support
Always synchronize access_masked_parent* with access_request_parent*
according to allowed_parent*.  This is required for audit support to be
able to get back to the reason of denial.

In a rename/link action, instead of always checking a rule two times for
the same parent directory of the source and the destination files, only
check it when an action on a child was not already allowed.  This also
enables us to keep consistent allowed_parent* status, which is required
to get back to the reason of denial.

For internal mount points, only upgrade allowed_parent* to true but do
not wrongfully set both of them to false otherwise.  This is also
required to get back to the reason of denial.

This does not impact the current behavior but slightly optimize code and
prepare for audit support that needs to know the exact reason why an
access was denied.

Cc: Günther Noack <gnoack@google.com>
Link: https://lore.kernel.org/r/20250108154338.1129069-14-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
2025-01-17 19:05:37 +01:00
..
.kunitconfig landlock: Add support for KUnit tests 2024-02-27 11:21:45 +01:00
access.h landlock: Simplify initially denied access rights 2025-01-17 19:05:35 +01:00
common.h landlock: Add support for KUnit tests 2024-02-27 11:21:45 +01:00
cred.c landlock: Don't lose track of restrictions on cred_transfer 2024-07-24 17:34:54 +02:00
cred.h landlock: Add signal scoping 2024-09-16 23:50:52 +02:00
fs.c landlock: Optimize file path walks and prepare for audit support 2025-01-17 19:05:37 +01:00
fs.h landlock: Move access types 2025-01-17 19:05:34 +01:00
Kconfig landlock: Add support for KUnit tests 2024-02-27 11:21:45 +01:00
limits.h landlock: Add signal scoping 2024-09-16 23:50:52 +02:00
Makefile landlock: Rename "ptrace" files to "task" 2024-03-08 18:22:16 +01:00
net.c landlock: Refactor network access mask management 2024-11-09 19:52:13 +01:00
net.h landlock: Support network rules with TCP bind and connect 2023-10-26 21:07:15 +02:00
object.c landlock: Format with clang-format 2022-05-09 12:31:10 +02:00
object.h landlock: Format with clang-format 2022-05-09 12:31:10 +02:00
ruleset.c landlock: Simplify initially denied access rights 2025-01-17 19:05:35 +01:00
ruleset.h landlock: Move access types 2025-01-17 19:05:34 +01:00
setup.c landlock: Rename "ptrace" files to "task" 2024-03-08 18:22:16 +01:00
setup.h LSM: Identify modules by more than name 2023-11-12 22:54:42 -05:00
syscalls.c landlock: Use scoped guards for ruleset in landlock_add_rule() 2025-01-14 11:57:45 +01:00
task.c landlock: Optimize scope enforcement 2024-11-09 19:52:13 +01:00
task.h landlock: Rename "ptrace" files to "task" 2024-03-08 18:22:16 +01:00