All of lore.kernel.org
 help / color / mirror / Atom feed
From: Siddh Raman Pant <code@siddh.me>
To: david@fromorbit.com
Cc: djwong@kernel.org, fgheet255t@gmail.com, hch@infradead.org,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
	riteshh@linux.ibm.com,
	syzbot+a8e049cd3abd342936b6@syzkaller.appspotmail.com,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] WARNING in iomap_iter
Date: Thu, 18 Aug 2022 16:30:31 +0530	[thread overview]
Message-ID: <20220818110031.89467-1-code@siddh.me> (raw)
In-Reply-To: <20220214025849.GP59729@dread.disaster.area>

This is probably due to mismatch in types between userspace API struct
and the kernel's internal struct, which leads to offset being overflowed
after getting converted from __u64 (unsigned long long) to loff_t (signed
long long), resulting in ridiculously negative offset value.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

---
 include/uapi/linux/loop.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/uapi/linux/loop.h b/include/uapi/linux/loop.h
index 6f63527dd2ed..33c07c467da4 100644
--- a/include/uapi/linux/loop.h
+++ b/include/uapi/linux/loop.h
@@ -53,12 +53,12 @@ struct loop_info64 {
 	__u64		   lo_device;			/* ioctl r/o */
 	__u64		   lo_inode;			/* ioctl r/o */
 	__u64		   lo_rdevice;			/* ioctl r/o */
-	__u64		   lo_offset;
-	__u64		   lo_sizelimit;/* bytes, 0 == max available */
-	__u32		   lo_number;			/* ioctl r/o */
-	__u32		   lo_encrypt_type;		/* obsolete, ignored */
-	__u32		   lo_encrypt_key_size;		/* ioctl w/o */
-	__u32		   lo_flags;
+	__s64		   lo_offset;
+	__s64		   lo_sizelimit;	/* bytes, 0 == max available */
+	__s32		   lo_number;			/* ioctl r/o */
+	__s32		   lo_encrypt_type;		/* obsolete, ignored */
+	__s32		   lo_encrypt_key_size;		/* ioctl w/o */
+	__s32		   lo_flags;
 	__u8		   lo_file_name[LO_NAME_SIZE];
 	__u8		   lo_crypt_name[LO_NAME_SIZE];
 	__u8		   lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
-- 
2.35.1



  reply	other threads:[~2022-08-18 11:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 23:46 [syzbot] WARNING in iomap_iter syzbot
2021-11-09  7:20 ` Christoph Hellwig
2022-02-12 20:41 ` syzbot
2022-02-13 14:34   ` Ritesh Harjani
2022-02-14  2:58     ` Dave Chinner
2022-08-18 11:00       ` Siddh Raman Pant [this message]
2022-08-18 11:11         ` Siddh Raman Pant
2022-08-18 14:50           ` Matthew Wilcox
2022-08-18 15:21             ` Siddh Raman Pant
2022-08-21  6:29               ` hch
2022-08-21 11:27                 ` Siddh Raman Pant
2022-08-21 11:48                   ` Siddh Raman Pant
2022-08-21 20:59                     ` syzbot
2022-08-22 14:45                     ` Matthew Wilcox
2022-08-22 14:49                       ` Siddh Raman Pant
2022-08-22 14:52                         ` Matthew Wilcox
2022-08-22 15:02                           ` Siddh Raman Pant
2022-08-23 15:21                             ` Siddh Raman Pant
2022-08-23 15:28                               ` Matthew Wilcox
2022-08-23 15:35                                 ` Siddh Raman Pant
2022-08-23 15:42                                   ` Matthew Wilcox
2022-08-23 15:54                                   ` syzbot
2022-08-23 15:38                               ` syzbot
2022-08-18 19:30           ` syzbot
2022-08-18 19:09         ` syzbot
2022-11-14 11:50 ` Siddh Raman Pant

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=20220818110031.89467-1-code@siddh.me \
    --to=code@siddh.me \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=fgheet255t@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=riteshh@linux.ibm.com \
    --cc=syzbot+a8e049cd3abd342936b6@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.