Commit 88da52c
committed
landlock: Fix d_parent walk
The WARN_ON_ONCE() in collect_domain_accesses() can be triggered when
trying to link a root mount point. This cannot work in practice because
this directory is mounted, but the VFS check is done after the call to
security_path_link().
Do not use source directory's d_parent when the source directory is the
mount point.
Cc: Günther Noack <[email protected]>
Cc: Paul Moore <[email protected]>
Cc: [email protected]
Reported-by: [email protected]
Fixes: b91c3e4 ("landlock: Add support for file reparenting with LANDLOCK_ACCESS_FS_REFER")
Closes: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
[mic: Fix commit message]
Signed-off-by: Mickaël Salaün <[email protected]>1 parent 1613e60 commit 88da52c
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
| 1113 | + | |
1113 | 1114 | | |
1114 | 1115 | | |
1115 | 1116 | | |
| |||
1157 | 1158 | | |
1158 | 1159 | | |
1159 | 1160 | | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
1160 | 1170 | | |
1161 | | - | |
1162 | | - | |
| 1171 | + | |
1163 | 1172 | | |
1164 | 1173 | | |
1165 | 1174 | | |
| |||
0 commit comments