linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Namjae Jeon" <namjae.jeon@samsung.com>
To: "'Matthew Wilcox'" <willy@infradead.org>
Cc: <linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<sj1557.seo@samsung.com>, <syzkaller-bugs@googlegroups.com>,
	"'syzbot'"
	<syzbot+da4fe66aaadd3c2e2d1c@syzkaller.appspotmail.com>
Subject: RE: UBSAN: shift-out-of-bounds in exfat_fill_super
Date: Tue, 26 Jan 2021 14:08:03 +0900	[thread overview]
Message-ID: <052101d6f3a1$3997c420$acc74c60$@samsung.com> (raw)
In-Reply-To: 

> > On Mon, Jan 25, 2021 at 09:33:14AM -0800, syzbot wrote:
> > > UBSAN: shift-out-of-bounds in fs/exfat/super.c:471:28 shift exponent
> > > 4294967294 is too large for 32-bit type 'int'
> >
> > This is an integer underflow:
> >
> >         sbi->dentries_per_clu = 1 <<
> >                 (sbi->cluster_size_bits - DENTRY_SIZE_BITS);
> >
> > I think the problem is that there is no validation of sect_per_clus_bits.
> > We should check it is at least DENTRY_SIZE_BITS and probably that it's
> > less than ... 16?  64?  I don't know what legitimate values are in this field, but I would imagine
> that 255 is completely unacceptable.
> exfat specification describe sect_per_clus_bits field of boot sector could be at most 32 and at least
                                                                                                 typo ^^16
> 0. And sect_size_bits can also affect this calculation, It also needs validation.
> I will fix it.
> Thanks!


      parent reply	other threads:[~2021-01-27 13:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 17:33 UBSAN: shift-out-of-bounds in exfat_fill_super syzbot
2021-01-25 18:39 ` Matthew Wilcox
2021-01-26  4:33   ` Randy Dunlap
2021-01-26  5:14     ` Namjae Jeon
2021-01-26  4:40   ` Namjae Jeon
2021-01-26  5:08   ` Namjae Jeon [this message]

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='052101d6f3a1$3997c420$acc74c60$@samsung.com' \
    --to=namjae.jeon@samsung.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    --cc=syzbot+da4fe66aaadd3c2e2d1c@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).