[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250519175640.2fcac001@leda.eworm.net>
Date: Mon, 19 May 2025 17:56:40 +0200
From: Christian Hesse <mail@...rm.de>
To: Lizhi Xu <lizhi.xu@...driver.com>
Cc: <hch@...radead.org>, <axboe@...nel.dk>, <linux-block@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <ming.lei@...hat.com>,
<syzbot+6af973a3b8dfd2faefdc@...kaller.appspotmail.com>,
<syzkaller-bugs@...glegroups.com>, Christian Heusel <christian@...sel.eu>,
Christian Hesse <mail@...rm.de>
Subject: Re: [PATCH V5] loop: Add sanity check for read/write_iter
Lizhi Xu <lizhi.xu@...driver.com> on Mon, 2025/04/28 22:36:
> Some file systems do not support read_iter/write_iter, such as selinuxfs
> in this issue.
> So before calling them, first confirm that the interface is supported and
> then call it.
>
> It is releavant in that vfs_iter_read/write have the check, and removal
> of their used caused szybot to be able to hit this issue.
>
> Fixes: f2fed441c69b ("loop: stop using vfs_iter__{read,write} for buffered
> I/O") Reported-by: syzbot+6af973a3b8dfd2faefdc@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=6af973a3b8dfd2faefdc
> Signed-off-by: Lizhi Xu <lizhi.xu@...driver.com>
> Reviewed-by: Christoph Hellwig <hch@....de>
> ---
> V1 -> V2: move check to loop_configure and loop_change_fd
> V2 -> V3: using helper for this check
> V3 -> V4: remove input parameters change and mode
> V4 -> V5: remove braces around !file->f_op->write_iter
This introduced a regression for Arch Linux, breaking boot media generated
with archiso [0]. More specifically it's this call of losetup [1].
There's a squashfs inside iso9660. Mounting the iso9660 filesystem works
fine, but losetup complains when setting up:
$ losetup --find --show --read-only -- /run/archiso/bootmnt/arch/x86_64/airootfs.sfs
losetup: /run/archiso/bootmnt/arch/x86_64/airootfs.sfs: failed to set up loop device: Invalid argument
This has been bisected to commit d278164832618bf2775c6a89e6434e2633de1eed in
mainline (and 9bd3feb324fce2e93e09d0a5b00887e81d337a8c for linux-6.14.y,
184b147b9f7f07577567a80fcc9314f2bd0b0b00 for linux-6.12.y). Thanks to
Christian Heusel for his work on this.
As the call tries to setup in read-only mode the check for
(file->f_op->read_iter) fails here, returning the -EINVAL we see.
Reported-by: Christian Hesse <mail@...rm.de>
Bisected-by: Christian Heusel <christian@...sel.eu>
[0] https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio-archiso
[1] https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio-archiso/-/blob/master/hooks/archiso?ref_type=heads#L88
--
Mit freundlichen Gruessen
Christian Hesse
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists