diff options
| author | André Almeida <[email protected]> | 2025-04-29 18:38:50 +0000 |
|---|---|---|
| committer | Miklos Szeredi <[email protected]> | 2025-04-30 08:55:27 +0000 |
| commit | 924577e4f6ca473de1528953a0e13505fae61d7b (patch) | |
| tree | 60f58d8e39f1b5d4003062bff519ea715026f146 /drivers/gpu/drm/amd/amdgpu/atom.c | |
| parent | ovl: remove unused forward declaration (diff) | |
| download | kernel-924577e4f6ca473de1528953a0e13505fae61d7b.tar.gz kernel-924577e4f6ca473de1528953a0e13505fae61d7b.zip | |
ovl: Fix nested backing file paths
When the lowerdir of an overlayfs is a merged directory of another
overlayfs, ovl_open_realfile() will fail to open the real file and point
to a lower dentry copy, without the proper parent path. After this,
d_path() will then display the path incorrectly as if the file is placed
in the root directory.
This bug can be triggered with the following setup:
mkdir -p ovl-A/lower ovl-A/upper ovl-A/merge ovl-A/work
mkdir -p ovl-B/upper ovl-B/merge ovl-B/work
cp /bin/cat ovl-A/lower/
mount -t overlay overlay -o \
lowerdir=ovl-A/lower,upperdir=ovl-A/upper,workdir=ovl-A/work \
ovl-A/merge
mount -t overlay overlay -o \
lowerdir=ovl-A/merge,upperdir=ovl-B/upper,workdir=ovl-B/work \
ovl-B/merge
ovl-A/merge/cat /proc/self/maps | grep --color cat
ovl-B/merge/cat /proc/self/maps | grep --color cat
The first cat will correctly show `/ovl-A/merge/cat`, while the second
one shows just `/cat`.
To fix that, uses file_user_path() inside of backing_file_open() to get
the correct file path for the dentry.
Co-developed-by: John Schoenick <[email protected]>
Signed-off-by: John Schoenick <[email protected]>
Signed-off-by: André Almeida <[email protected]>
Fixes: def3ae83da02 ("fs: store real path instead of fake path in backing file f_path")
Cc: <[email protected]> # v6.7
Signed-off-by: Miklos Szeredi <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/atom.c')
0 files changed, 0 insertions, 0 deletions
