]> www.infradead.org Git - nvme.git/commit
loop: Add sanity check for read/write_iter
authorLizhi Xu <lizhi.xu@windriver.com>
Mon, 28 Apr 2025 14:36:26 +0000 (22:36 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 5 May 2025 13:18:05 +0000 (07:18 -0600)
commitf5c84eff634ba003326aa034c414e2a9dcb7c6a7
tree9f808b9e4344dff4bc0dd6fdcd6d4f13d2ac64d3
parent6d732e8d1e6ddc27bbdebbee48fa5825203fb4a9
loop: Add sanity check for read/write_iter

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@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=6af973a3b8dfd2faefdc
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250428143626.3318717-1-lizhi.xu@windriver.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c