On Wed, Jun 04, 2025 at 12:20:11AM +0100, Al Viro wrote: > From: =?UTF-8?q?KONDO=20KAZUMA=28=E8=BF=91=E8=97=A4=E3=80=80=E5=92=8C?= > =?UTF-8?q?=E7=9C=9F=29?= <kazuma-kondo@xxxxxxx> > > Mounting overlayfs with a directory on real rootfs (initramfs) > as upperdir has failed with following message since commit > db04662e2f4f ("fs: allow detached mounts in clone_private_mount()"). > > [ 4.080134] overlayfs: failed to clone upperpath > > Overlayfs mount uses clone_private_mount() to create internal mount > for the underlying layers. > > The commit made clone_private_mount() reject real rootfs because > it does not have a parent mount and is in the initial mount namespace, > that is not an anonymous mount namespace. > > This issue can be fixed by modifying the permission check > of clone_private_mount() following [1]. > > Fixes: db04662e2f4f ("fs: allow detached mounts in clone_private_mount()") > Link: https://lore.kernel.org/all/20250514190252.GQ2023217@ZenIV/ [1] > Link: https://lore.kernel.org/all/20250506194849.GT2023217@ZenIV/ > Suggested-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> > Signed-off-by: Kazuma Kondo <kazuma-kondo@xxxxxxx> > Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> > --- Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx>