mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+81092778aac03460d6b7@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [ocfs2?] kernel BUG in ocfs2_truncate_inline
Date: Wed,  9 Oct 2024 17:00:03 +0800	[thread overview]
Message-ID: <tencent_11642C456F589720E8CEEC46CD2879666E0A@qq.com> (raw)
In-Reply-To: <67062030.050a0220.3f80e.0024.GAE@google.com>

offset or offset + len greater than UINT_MAX, if true, it will overflow in ocfs2_truncate_inline

#syz test

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index ad131a2fc58e..ed26ec8ac6b6 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2117,6 +2117,9 @@ static long ocfs2_fallocate(struct file *file, int mode, loff_t offset,
 			return ret;
 	}
 
+	if (offset > UINT_MAX || offset + len > UINT_MAX)
+		return -EFBIG;
+
 	if (mode & FALLOC_FL_PUNCH_HOLE)
 		cmd = OCFS2_IOC_UNRESVSP64;
 


  reply	other threads:[~2024-10-09  9:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  6:18 [syzbot] " syzbot
2024-10-09  9:00 ` Edward Adam Davis [this message]
2024-10-09 14:11   ` syzbot
2024-10-09 15:05 ` [PATCH] ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow Edward Adam Davis
2024-10-10 12:21   ` Joseph Qi
2024-10-10 14:31     ` [PATCH V2] " Edward Adam Davis
2024-10-11  1:07       ` Su Yue
2024-10-11  2:01         ` Joseph Qi
2024-10-16  2:08           ` Joseph Qi
2024-10-16  3:22             ` [PATCH V3] " Edward Adam Davis
2024-10-16  9:49               ` Joseph Qi
2024-10-16 11:43                 ` [PATCH V4] " Edward Adam Davis
2024-10-16 11:47                   ` Joseph Qi
2024-10-16 11:54                     ` Joseph Qi
2024-10-10 14:32 ` [ocfs2?] kernel BUG in ocfs2_truncate_inline Edward Adam Davis
2024-10-10 16:31   ` [syzbot] " syzbot
2024-10-16  3:29 ` Edward Adam Davis
2024-10-16  4:59   ` [syzbot] " syzbot

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=tencent_11642C456F589720E8CEEC46CD2879666E0A@qq.com \
    --to=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+81092778aac03460d6b7@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®