diff options
| author | Chris Mason <mason@kernel.org> | 2026-10-07 10:15:11 +0000 |
|---|---|---|
| committer | Amir Goldstein <amir73il@gmail.com> | 2026-10-29 13:20:57 +0100 |
| commit | e34d2ef818e4c7676d8d8e1bf43e6a1ed39efb2a (patch) | |
| tree | 32c8bb6020e03ecd586b28973b0dbaa18a04e24a /scripts/basic | |
| parent | ba227ed05b385926094741e2d566789525c36085 (diff) | |
| download | linux-e34d2ef818e4c7676d8d8e1bf43e6a1ed39efb2a.tar.gz linux-e34d2ef818e4c7676d8d8e1bf43e6a1ed39efb2a.zip | |
ovl: check that the parents of volatile/dirty are dirs
An unprivileged user crashes the kernel by mounting overlayfs with the
volatile option.
A dentry that serves as the parent of a lookup must be a directory.
ovl_create_volatile_dirty() walks work/incompat/volatile/dirty by name,
and ovl_lookup_or_create() returns an existing entry whatever its type.
A file or a symlink that another task creates during the mount becomes
the parent of the next lookup, which calls a NULL ->lookup.
An unprivileged user mounted overlayfs with "volatile" in a user
namespace while a second process created a symlink named work/incompat,
and the mount task oopsed on a NULL ->lookup call.
Fix this by returning -ENOTDIR from ovl_lookup_or_create() when the
caller asked for a directory and the existing entry is a non-dir.
Fixes: c86243b090bc ("ovl: provide a mount option "volatile"")
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/basic')
0 files changed, 0 insertions, 0 deletions
