ACK [L,J]: [SRU][L/K/J/F][PATCH 0/1] UBUNTU: SAUCE: overlayfs: fix reference count mismatch

Roxana Nicolescu roxana.nicolescu at canonical.com
Wed Aug 2 08:55:51 UTC 2023


On 22/06/2023 11:37, Andrea Righi wrote:
> BugLink: https://bugs.launchpad.net/bugs/2016398
>
> [Impact]
>
> Opened files reported in /proc/pid/map_files can be shows with the wrong
> mount point using overlayfs with filesystem namspaces.
>
> This incorrect behavior is fixed:
>
>    UBUNTU: SAUCE: overlayfs: fix incorrect mnt_id of files opened from map_files
>
> However, the fix introduced a new regression, the reference to the
> original file stored in vma->vm_prfile is not properly released when
> vma->vm_prfile is replaced with a new file.
>
> This can cause a reference counter unbalance, leading errors such as
> "target is busy" when trying to unmount overlayfs, even if the
> filesystem has not active reference.
>
> [Test case]
>
> Reproducer provided by original bug reporter:
> https://launchpadlibrarian.net/663151659/overlayfsscript_example
>
> [Fix]
>
> Fix by properly releasing the original file stored in vm_prfile.
>
> [Regression potential]
>
> This fix seems to solve the reported bug (verified with the reproducer)
> and it doesn't seem to introduce other regressions or behavior change.
>
> However, we may experience regressions in overlayfs or potentially other
> "target is busy" errors when unmounting overlayfs filesystems with this
> fix applied, if there are still other corner cases not covered properly.
>
>
Acked-by: Roxana Nicolescu <roxana.nicolescu at canonical.com>



More information about the kernel-team mailing list