Unverified Commit f7ef7de6 authored by Mickaël Salaün's avatar Mickaël Salaün
Browse files

landlock: Improve variable scope

This is now possible thanks to the disconnected directory fix.

Cc: Günther Noack <gnoack@google.com>
Cc: Song Liu <song@kernel.org>
Cc: Tingmao Wang <m@maowtm.org>
Link: https://lore.kernel.org/r/20251128172200.760753-3-mic@digikod.net


Signed-off-by: default avatarMickaël Salaün <mic@digikod.net>
parent 49c9e09d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -838,7 +838,6 @@ static bool is_access_to_paths_allowed(
	 * restriction.
	 */
	while (true) {
		struct dentry *parent_dentry;
		const struct landlock_rule *rule;

		/*
@@ -931,7 +930,9 @@ static bool is_access_to_paths_allowed(
			walker_path.dentry = walker_path.mnt->mnt_root;
			dget(walker_path.dentry);
		} else {
			parent_dentry = dget_parent(walker_path.dentry);
			struct dentry *const parent_dentry =
				dget_parent(walker_path.dentry);

			dput(walker_path.dentry);
			walker_path.dentry = parent_dentry;
		}