Commit 058518c
committed
landlock: Align partial refer access checks with final ones
Fix a logical issue that could have been visible if the source or the
destination of a rename/link action was allowed for either the source or
the destination but not both. However, this logical bug is unreachable
because either:
- the rename/link action is allowed by the access rights tied to the
same mount point (without relying on access rights in a parent mount
point) and the access request is allowed (i.e. allow_parent1 and
allow_parent2 are true in current_check_refer_path),
- or a common rule in a parent mount point updates the access check for
the source and the destination (cf. is_access_to_paths_allowed).
See the following layout1.refer_part_mount_tree_is_allowed test that
work with and without this fix.
This fix does not impact current code but it is required for the audit
support.
Cc: Günther Noack <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mickaël Salaün <[email protected]>1 parent d6c7cf8 commit 058518c
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
568 | 574 | | |
569 | 575 | | |
570 | 576 | | |
| |||
582 | 588 | | |
583 | 589 | | |
584 | 590 | | |
585 | | - | |
| 591 | + | |
| 592 | + | |
586 | 593 | | |
587 | 594 | | |
588 | 595 | | |
| |||
771 | 778 | | |
772 | 779 | | |
773 | 780 | | |
| 781 | + | |
| 782 | + | |
774 | 783 | | |
775 | 784 | | |
776 | 785 | | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
777 | 789 | | |
778 | 790 | | |
779 | 791 | | |
| |||
0 commit comments