Mickaël Salaün 6c6e852c94
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-10 12:12:43 +01:00
..
2024-11-30 18:14:56 -08:00
2024-11-03 01:28:06 -05:00
2024-12-18 12:10:15 -08:00
2024-10-11 14:34:16 -04:00
2024-09-16 18:19:47 +02:00
2024-08-19 22:36:26 -04:00
\n
2024-11-21 09:55:45 -08:00