Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #87614 > unrolled thread

Bug#1106070: [6.12.y regression] loosetup: failed to set up loop device: Invalid argument after 184b147b9f7f ("loop: Add sanity check for read/write_iter")

Started bySalvatore Bonaccorso <carnil@debian.org>
First post2025-05-20 08:10 +0200
Last post2025-05-20 17:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.debian.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#1106070: [6.12.y regression] loosetup: failed to set up loop device: Invalid argument after 184b147b9f7f ("loop: Add sanity check for read/write_iter") Salvatore Bonaccorso <carnil@debian.org> - 2025-05-20 08:10 +0200
    Bug#1106070: [6.12.y regression] loosetup: failed to set up loop device: Invalid argument after 184b147b9f7f ("loop: Add sanity check for read/write_iter") Salvatore Bonaccorso <carnil@debian.org> - 2025-05-20 08:20 +0200
    Bug#1106070: [6.12.y regression] loosetup: failed to set up loop device: Invalid argument after 184b147b9f7f ("loop: Add sanity check for read/write_iter") Christian Hesse <list@eworm.de> - 2025-05-20 09:10 +0200
    Bug#1106070: [6.12.y regression] loosetup: failed to set up loop device: Invalid argument after 184b147b9f7f ("loop: Add sanity check for read/write_iter") Jens Axboe <axboe@kernel.dk> - 2025-05-20 17:30 +0200

#87614 — Bug#1106070: [6.12.y regression] loosetup: failed to set up loop device: Invalid argument after 184b147b9f7f ("loop: Add sanity check for read/write_iter")

FromSalvatore Bonaccorso <carnil@debian.org>
Date2025-05-20 08:10 +0200
SubjectBug#1106070: [6.12.y regression] loosetup: failed to set up loop device: Invalid argument after 184b147b9f7f ("loop: Add sanity check for read/write_iter")
Message-ID<KOokN-4nRc-1@gated-at.bofh.it>
Hi

In Debian Roland Clobus reported a regression with setting up loop
devices from a backing squashfs file lying on read-only mounted target
directory from a iso.

The original report is at:
https://bugs.debian.org/1106070

Quoting the report:

On Mon, May 19, 2025 at 12:15:10PM +0200, Roland Clobus wrote:
> Package: linux-image-6.12.29-amd64
> Version: 6.12.29-1
> Severity: important
> X-Debbugs-Cc: debian-amd64@lists.debian.org
> User: debian-amd64@lists.debian.org
> Usertags: amd64
> X-Debbugs-Cc: phil@hands.com
> User: debian-qa@lists.debian.org
> Usertags: openqa
> X-Debbugs-Cc: debian-boot
> 
> Hello maintainers of the kernel,
> 
> The new kernel (6.12.29) has a modified behaviour (compared to 6.12.27) for
> the loop device.
> 
> This causes the Debian live images (for sid) to fail to boot.
> 
> The change happened between 20250518T201633Z and 20250519T021902Z, which
> matches the upload of 6.12.29 (https://tracker.debian.org/news/1646619/accepted-linux-signed-amd64-612291-source-into-unstable/)
> at 20250518T230426Z.
> 
> To reproduce:
> * Download the daily live image from https://openqa.debian.net/tests/396941/asset/iso/smallest-build_sid_20250519T021902Z.iso
> * Boot into the live image (the first boot option)
> * Result: an initramfs shell (instead of a live system) -> FAIL
> * Try: `losetup -r /dev/loop1 /run/live/medium/live/filesystem.squashfs`
> * Result: `failed to set up loop device: invalid argument` -> FAIL
> * Try: `cp /run/live/medium/live/filesystem.squashfs /`
> * Try: `losetup -r /dev/loop2 /filesystem.squashfs`
> * Result: `loop2: detected capacity change from 0 to 1460312` -> PASS
> 
> It appears that the loopback device cannot be used any more with the mount
> /run/live/medium (which is on /dev/sr0).
> 
> I've verified: the md5sum of the squashfs file is OK.
> 
> The newer kernel is not in trixie yet.
> 
> With kind regards,
> Roland Clobus

A short reproducer is as follows:

iso="netinst.iso"
url="https://openqa.debian.net/tests/396941/asset/iso/smallest-build_sid_20250519T021902Z.iso"
if [ ! -e "${iso}" ]; then
        wget "${url}" -O "${iso}"
fi
mountdir="$(mktemp -d)"
mount -v "./${iso}" "${mountdir}"
losetup -v -r -f "${mountdir}/live/filesystem.squashfs"
loosetup -l

resulting in:

mount: /tmp/tmp.HgbNe7ek3h: WARNING: source write-protected, mounted read-only.
mount: /dev/loop0 mounted on /tmp/tmp.HgbNe7ek3h.
losetup: /tmp/tmp.HgbNe7ek3h/live/filesystem.squashfs: failed to set up loop device: Invalid argument
NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE         DIO LOG-SEC
/dev/loop0         0      0         1  0 /root/netinst.iso   0     512

Reverting 184b147b9f7f ("loop: Add sanity check for read/write_iter")
on top of 6.12.29 fixes the issue:

mount: /tmp/tmp.ACkkdCdYvB: WARNING: source write-protected, mounted read-only.
mount: /dev/loop0 mounted on /tmp/tmp.ACkkdCdYvB.
NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE                                    DIO LOG-SEC
/dev/loop1         0      0         0  1 /tmp/tmp.ACkkdCdYvB/live/filesystem.squashfs   0     512
/dev/loop0         0      0         1  0 /root/netinst.iso                              0     512

For completeness, netinst.iso is a iso9660 fstype with mount options
"ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8".

#regzbot introduced: 184b147b9f7f
#regzbot link: https://bugs.debian.org/1106070

Regards,
Salvatore

[toc] | [next] | [standalone]


#87615

FromSalvatore Bonaccorso <carnil@debian.org>
Date2025-05-20 08:20 +0200
Message-ID<KOout-4nUl-1@gated-at.bofh.it>
In reply to#87614
On Tue, May 20, 2025 at 07:57:31AM +0200, Salvatore Bonaccorso wrote:
> Hi
> 
> In Debian Roland Clobus reported a regression with setting up loop
> devices from a backing squashfs file lying on read-only mounted target
> directory from a iso.
> 
> The original report is at:
> https://bugs.debian.org/1106070
> 
> Quoting the report:
> 
> On Mon, May 19, 2025 at 12:15:10PM +0200, Roland Clobus wrote:
> > Package: linux-image-6.12.29-amd64
> > Version: 6.12.29-1
> > Severity: important
> > X-Debbugs-Cc: debian-amd64@lists.debian.org
> > User: debian-amd64@lists.debian.org
> > Usertags: amd64
> > X-Debbugs-Cc: phil@hands.com
> > User: debian-qa@lists.debian.org
> > Usertags: openqa
> > X-Debbugs-Cc: debian-boot
> > 
> > Hello maintainers of the kernel,
> > 
> > The new kernel (6.12.29) has a modified behaviour (compared to 6.12.27) for
> > the loop device.
> > 
> > This causes the Debian live images (for sid) to fail to boot.
> > 
> > The change happened between 20250518T201633Z and 20250519T021902Z, which
> > matches the upload of 6.12.29 (https://tracker.debian.org/news/1646619/accepted-linux-signed-amd64-612291-source-into-unstable/)
> > at 20250518T230426Z.
> > 
> > To reproduce:
> > * Download the daily live image from https://openqa.debian.net/tests/396941/asset/iso/smallest-build_sid_20250519T021902Z.iso
> > * Boot into the live image (the first boot option)
> > * Result: an initramfs shell (instead of a live system) -> FAIL
> > * Try: `losetup -r /dev/loop1 /run/live/medium/live/filesystem.squashfs`
> > * Result: `failed to set up loop device: invalid argument` -> FAIL
> > * Try: `cp /run/live/medium/live/filesystem.squashfs /`
> > * Try: `losetup -r /dev/loop2 /filesystem.squashfs`
> > * Result: `loop2: detected capacity change from 0 to 1460312` -> PASS
> > 
> > It appears that the loopback device cannot be used any more with the mount
> > /run/live/medium (which is on /dev/sr0).
> > 
> > I've verified: the md5sum of the squashfs file is OK.
> > 
> > The newer kernel is not in trixie yet.
> > 
> > With kind regards,
> > Roland Clobus
> 
> A short reproducer is as follows:
> 
> iso="netinst.iso"
> url="https://openqa.debian.net/tests/396941/asset/iso/smallest-build_sid_20250519T021902Z.iso"
> if [ ! -e "${iso}" ]; then
>         wget "${url}" -O "${iso}"
> fi
> mountdir="$(mktemp -d)"
> mount -v "./${iso}" "${mountdir}"
> losetup -v -r -f "${mountdir}/live/filesystem.squashfs"
> loosetup -l
> 
> resulting in:
> 
> mount: /tmp/tmp.HgbNe7ek3h: WARNING: source write-protected, mounted read-only.
> mount: /dev/loop0 mounted on /tmp/tmp.HgbNe7ek3h.
> losetup: /tmp/tmp.HgbNe7ek3h/live/filesystem.squashfs: failed to set up loop device: Invalid argument
> NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE         DIO LOG-SEC
> /dev/loop0         0      0         1  0 /root/netinst.iso   0     512
> 
> Reverting 184b147b9f7f ("loop: Add sanity check for read/write_iter")
> on top of 6.12.29 fixes the issue:
> 
> mount: /tmp/tmp.ACkkdCdYvB: WARNING: source write-protected, mounted read-only.
> mount: /dev/loop0 mounted on /tmp/tmp.ACkkdCdYvB.
> NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE                                    DIO LOG-SEC
> /dev/loop1         0      0         0  1 /tmp/tmp.ACkkdCdYvB/live/filesystem.squashfs   0     512
> /dev/loop0         0      0         1  0 /root/netinst.iso                              0     512
> 
> For completeness, netinst.iso is a iso9660 fstype with mount options
> "ro,relatime,nojoliet,check=s,map=n,blocksize=2048,iocharset=utf8".
> 
> #regzbot introduced: 184b147b9f7f
> #regzbot link: https://bugs.debian.org/1106070

Just tested: The regression exists as well in 6.15-rc7 so it is not
specific to the stable 6.12.y update.

Regards,
Salvatore

[toc] | [prev] | [next] | [standalone]


#87618

FromChristian Hesse <list@eworm.de>
Date2025-05-20 09:10 +0200
Message-ID<KOpgR-4ory-3@gated-at.bofh.it>
In reply to#87614

[Multipart message — attachments visible in raw view] — view raw

Salvatore Bonaccorso <carnil@debian.org> on Tue, 2025/05/20 07:57:
> In Debian Roland Clobus reported a regression with setting up loop
> devices from a backing squashfs file lying on read-only mounted target
> directory from a iso.
> 
> The original report is at:
> https://bugs.debian.org/1106070

We are suffering the same for Arch Linux. Already reported here:

https://lore.kernel.org/all/20250519175640.2fcac001@leda.eworm.net/
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

[toc] | [prev] | [next] | [standalone]


#87624

FromJens Axboe <axboe@kernel.dk>
Date2025-05-20 17:30 +0200
Message-ID<KOx4K-4toM-1@gated-at.bofh.it>
In reply to#87614
Fixed here:

https://git.kernel.dk/cgit/linux/commit/?h=block-6.15&id=355341e4359b2d5edf0ed5e117f7e9e7a0a5dac0

and will land upstream this week.

-- 
Jens Axboe

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web