diff options
| author | Chris Mason <mason@kernel.org> | 2026-10-07 12:10:59 +0000 |
|---|---|---|
| committer | Amir Goldstein <amir73il@gmail.com> | 2026-10-29 13:22:41 +0100 |
| commit | 2001cd7ca5560198131e46c6ca3c3472b06145c2 (patch) | |
| tree | 977b711d310c020a7ecb23d7bb687f97f93888da /scripts/Makefile.thinlto | |
| parent | f635192ad223d2009ee640b63adf5ce3198aa338 (diff) | |
| download | linux-2001cd7ca5560198131e46c6ca3c3472b06145c2.tar.gz linux-2001cd7ca5560198131e46c6ca3c3472b06145c2.zip | |
ovl: fix a torn path in ovl_get_redirect()
A hard link of a metacopy file that races with a rename of an ancestor
stores a redirect to the wrong lower file.
Each component of an absolute redirect must be the name that a dentry
has in the parent that the walk continues with. ovl_get_redirect()
copies the name under d_lock and calls dget_parent() after the unlock,
and the callers for a hard link hold no lock that stops a rename across
directories. A rename between the two steps combines the old name with
the new parent.
With delays in ovl_get_redirect(), an unprivileged user hard-linked a
metacopy file while renaming its ancestor to another directory, the
stored redirect named another lower path, and after a remount the file
showed the data of a root-only file.
Fix this by taking the parent first and checking it again under d_lock.
Fixes: e04527fefba6 ("ovl: fix dentry leak in ovl_get_redirect")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Mason <mason@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
