APPLIED/Cmnt: [PATCH 0/1][SRU][D/E] Fix uuid-less squashfs overlayfs corruption issue (LP: #1824407)

Stefan Bader stefan.bader at canonical.com
Thu Nov 28 15:58:26 UTC 2019


On 22.11.19 13:16, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1824407
> 
> == SRU Justification Disco, Eoan, Focal ==
> 
> Multiple squashfs filesystems with overlayfs cause file corruption issues
> when modifying zero sized files
> 
> == Fix ==
> 
> The current fix is pending in https://github.com/amir73il/linux/commit/b2d4f0ea5af42e16e154254de99da064f3ac551a
> and should be landing in Linux v5.5
> 
> == Test case ==
> 
> With an Ubuntu ISO on the cdrom drive, use:
> 
> #!/bin/bash -x
> mkdir -p /cdrom
> mount -t iso9660 -o ro,noatime /dev/sr0 /cdrom
> sleep 1
> mkdir -p /cow
> mount -t tmpfs -o 'rw,noatime,mode=755' tmpfs /cow
> sleep 1
> mkdir -p /cow/upper
> mkdir -p /cow/work
> modprobe -q -b overlay
> sleep 1
> modprobe -q -b loop
> sleep 1
> dev=$(losetup -f)
> mkdir -p /filesystem.squashfs
> losetup $dev /cdrom/casper/filesystem.squashfs
> mount -t squashfs -o ro,noatime $dev /filesystem.squashfs
> sleep 1
> 
> dev=$(losetup -f)
> mkdir -p /installer.squashfs
> losetup $dev /cdrom/casper/installer.squashfs
> mount -t squashfs -o ro,noatime $dev /installer.squashfs
> sleep 1
> 
> mkdir -p /root-tmp
> mount -t overlay -o 'upperdir=/cow/upper,lowerdir=/installer.squashfs:/filesystem.squashfs,workdir=/cow/work' /cow /root-tmp
> 
> FILE=/root-tmp/etc/.pwd.lock
> 
> echo foo > $FILE
> cat $FILE
> sync
> #
> # dropping caches or remounting causes the bug
> #
> echo 3 > /proc/sys/vm/drop_caches
> cat $FILE
> 
> Without the fix the cat of the file will produce an error. With the the
> cat will work correctly.
> 
> == Regression Potential ==
> 
> There is an unhandled corner case:
>     - two filesystems, A and B, both have null uuid
>     - upper layer is on A
>     - lower layer 1 is also on A
>     - lower layer 2 is on B
> 
> However, since this is an issue without the fix and will be addressed later
> with subsequent fixes once they are OK with upstream I think the risk is
> minimal considering nobody is complaining about these corner cases with the
> current broken overlayfs squashfs layering.
> 
> ----
> 
> Amir Goldstein (1):
>   ovl: fix lookup failure on multi lower squashfs
> 
>  fs/overlayfs/namei.c     |  8 ++++++++
>  fs/overlayfs/ovl_entry.h |  2 ++
>  fs/overlayfs/super.c     | 24 +++++++++++++++++-------
>  3 files changed, 27 insertions(+), 7 deletions(-)
> 
Applied to eoan,disco/master-next (adding SAUCE tag as it did not make it to
linux-next, yet). Thanks.

-Stefan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20191128/78015789/attachment.sig>


More information about the kernel-team mailing list