Linux Security Modules development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Brauner" <brauner@kernel.org>
Cc: linux-security-module@vger.kernel.org, selinux@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-usb@vger.kernel.org,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Mark Fasheh" <mark@fasheh.com>,
	"Joel Becker" <jlbec@evilplan.org>,
	"Joseph Qi" <joseph.qi@linux.alibaba.com>
Subject: Re: [PATCH RFC 01/41] loop: refuse backing files that aren't open for reading
Date: Tue, 10 Nov 2026 09:27:23 +0000	[thread overview]
Message-ID: <sashiko-outbox-206753@kernel.org> (raw)
In-Reply-To: <20261110-work-loop-pseudo-v1-1-4c998976c6c7@kernel.org>

> loop_configure() takes any file as long as it implements ->read_iter().
> Loop itself never checked whether the file was actually opened for
> reading. Buffered I/O went through vfs_iter_read() which refuses files
> without FMODE_READ. Direct I/O has called ->read_iter() of the backing
> file directly ever since loop grew support for it.
> 
> Since commit f2fed441c69b ("loop: stop using vfs_iter_{read,write} for
> buffered I/O") buffered I/O calls ->read_iter() directly as well. That
> commit was about O_DIRECT handling and the FMODE_READ check went away
> as a side effect.
> 
> So whoever can set up a loop device can read a file it was only allowed
> to open for writing. Open the file O_WRONLY, configure a loop device
> with it and read the contents through the loop device.
> 
> Refuse backing files that aren't open for reading. Loop always reads
> from its backing file so a write-only backing file never made sense in
> the first place.
> 
> Fixes: bc07c10a3603 ("block: loop: support DIO & AIO")
> Fixes: f2fed441c69b ("loop: stop using vfs_iter_{read,write} for buffered I/O")
> Cc: stable@vger.kernel.org
> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110-work-loop-pseudo-v1-0-4c998976c6c7@kernel.org?part=1


  reply	other threads:[~2026-11-10  9:27 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  9:14 [PATCH RFC 00/41] fs: don't use pseudo filesystem files as storage Christian Brauner
2026-11-10  9:14 ` [PATCH RFC 01/41] loop: refuse backing files that aren't open for reading Christian Brauner
2026-11-10  9:27   ` sashiko-bot [this message]
2026-11-10 12:53   ` Jan Kara
2026-11-11 14:55   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 02/41] nvmet: check that the file backend supports ->{read,write}_iter Christian Brauner
2026-11-10  9:23   ` sashiko-bot
2026-11-10 12:53   ` Jan Kara
2026-11-11 14:56   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 03/41] target: fileio: check that the backing file " Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-10 12:54   ` Jan Kara
2026-11-11 14:56   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 04/41] fs: add SB_I_PSEUDO Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-10 12:55   ` Jan Kara
2026-11-11 15:04   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 05/41] kernfs: use fc_init_pseudo() Christian Brauner
2026-11-10  9:25   ` sashiko-bot
2026-11-10 12:56   ` Jan Kara
2026-11-11 15:04   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 06/41] proc: " Christian Brauner
2026-11-10  9:25   ` sashiko-bot
2026-11-10 12:56   ` Jan Kara
2026-11-11 15:04   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 07/41] binfmt_misc: " Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-10 12:56   ` Jan Kara
2026-11-10  9:14 ` [PATCH RFC 08/41] mqueue: " Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-11 15:05   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 09/41] bpf: use fc_init_pseudo() for bpffs Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-11 15:05   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 10/41] nullfs: use fc_init_pseudo() Christian Brauner
2026-11-10  9:23   ` sashiko-bot
2026-11-10 12:57   ` Jan Kara
2026-11-11 15:05   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 11/41] failfs: " Christian Brauner
2026-11-10  9:23   ` sashiko-bot
2026-11-10 12:57   ` Jan Kara
2026-11-11 15:05   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 12/41] rust_binderfs: " Christian Brauner
2026-11-10  9:27   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 13/41] devpts: " Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 14/41] debugfs: " Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-10 12:59   ` Jan Kara
2026-11-10  9:14 ` [PATCH RFC 15/41] tracefs: " Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 16/41] configfs: " Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-10 12:59   ` Jan Kara
2026-11-11  9:46   ` Breno Leitao
2026-11-10  9:14 ` [PATCH RFC 17/41] securityfs: " Christian Brauner
2026-11-10  9:27   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 18/41] selinux: use fc_init_pseudo() for selinuxfs Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 19/41] smack: use fc_init_pseudo() for smackfs Christian Brauner
2026-11-10  9:24   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 20/41] apparmor: use fc_init_pseudo() for apparmorfs Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 21/41] nfsd: use fc_init_pseudo() Christian Brauner
2026-11-10  9:25   ` sashiko-bot
2026-11-10 14:55   ` Chuck Lever
2026-11-10  9:14 ` [PATCH RFC 22/41] sunrpc: use fc_init_pseudo() for rpc_pipefs Christian Brauner
2026-11-10  9:25   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 23/41] fuse: use fc_init_pseudo() for fusectl Christian Brauner
2026-11-10  9:25   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 24/41] efivarfs: use fc_init_pseudo() Christian Brauner
2026-11-10  9:25   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 25/41] pstore: " Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 26/41] xenfs: " Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 27/41] openpromfs: " Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 28/41] ocfs2: use fc_init_pseudo() for dlmfs Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-10 13:01   ` Jan Kara
2026-11-10  9:14 ` [PATCH RFC 29/41] s390/hypfs: use fc_init_pseudo() Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 30/41] powerpc/spufs: " Christian Brauner
2026-11-10  9:31   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 31/41] usb: gadget: f_fs: " Christian Brauner
2026-11-10  9:26   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 32/41] usb: gadget: gadgetfs: " Christian Brauner
2026-11-10  9:27   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 33/41] fs: add file_is_pseudo() Christian Brauner
2026-11-10  9:29   ` sashiko-bot
2026-11-10 13:02   ` Jan Kara
2026-11-10  9:14 ` [PATCH RFC 34/41] loop: refuse files on pseudo filesystems as backing files Christian Brauner
2026-11-10  9:33   ` sashiko-bot
2026-11-10 13:03   ` Jan Kara
2026-11-10  9:14 ` [PATCH RFC 35/41] zloop: refuse zone files on pseudo filesystems Christian Brauner
2026-11-10  9:36   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 36/41] nvmet: refuse files on pseudo filesystems as namespace backing files Christian Brauner
2026-11-10  9:31   ` sashiko-bot
2026-11-10 15:07   ` Bui Nguyen Nhu Quynh
2026-11-10  9:14 ` [PATCH RFC 37/41] target: fileio: refuse files on pseudo filesystems as " Christian Brauner
2026-11-10  9:33   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 38/41] fuse: refuse files on pseudo filesystems as passthrough " Christian Brauner
2026-11-10  9:28   ` sashiko-bot
2026-11-10 10:14   ` Amir Goldstein
2026-11-11 15:12   ` Christoph Hellwig
2026-11-10  9:14 ` [PATCH RFC 39/41] usb: gadget: f_mass_storage: refuse files on pseudo filesystems Christian Brauner
2026-11-10  9:28   ` sashiko-bot
2026-11-10  9:14 ` [PATCH RFC 40/41] erofs: refuse files on pseudo filesystems as backing files Christian Brauner
2026-11-10  9:29   ` sashiko-bot
2026-11-10 20:45   ` Gao Xiang
2026-11-10  9:14 ` [PATCH RFC 41/41] selftests/filesystems: add backing file tests for pseudo files Christian Brauner
2026-11-10  9:29   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-206753@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=brauner@kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox