From: Matthew Wilcox <willy@infradead.org>
To: Atul Raut <rauji.raut@gmail.com>
Cc: linux-fsdevel@vger.kernel.org,
syzbot+e295147e14b474e4ad70@syzkaller.appspotmail.com,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: pagevec: Fix array-index-out-of-bounds error
Date: Fri, 25 Aug 2023 02:56:28 +0100 [thread overview]
Message-ID: <ZOgKTO612u1Fn7PB@casper.infradead.org> (raw)
In-Reply-To: <20230825001720.19101-1-rauji.raut@gmail.com>
On Thu, Aug 24, 2023 at 05:17:21PM -0700, Atul Raut wrote:
> ntfs_evict_inode+0x20/0x48 fs/ntfs3/inode.c:1790
No. This is your clue. ntfs corrupts memory. You can't take bug
reports involving ntfs seriously. Ignore everything tagged with ntfs.
> In folio_batch_add, which contains folios rather
> than fixed-size pages, there is a chance that the
> array index will fall outside of bounds.
> Before adding folios, examine the available space to fix.
This is definitely the wrong fix.
> static inline unsigned folio_batch_add(struct folio_batch *fbatch,
> struct folio *folio)
> {
> - fbatch->folios[fbatch->nr++] = folio;
> + if (folio_batch_space(fbatch))
> + fbatch->folios[fbatch->nr++] = folio;
Did you look at what folio_batch_space() actually does?
static inline unsigned int folio_batch_space(struct folio_batch *fbatch)
{
return PAGEVEC_SIZE - fbatch->nr;
}
So if fbatch->nr is 255, what will it return? How will
folio_batch_add() behave?
The right way to fix this problem is to find the data corrupter in NTFS.
You can't "fix" it anywhere else.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2023-08-25 2:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-25 0:17 pagevec: Fix array-index-out-of-bounds error Atul Raut
2023-08-25 1:56 ` Matthew Wilcox [this message]
2023-08-25 2:05 ` Atul Raut
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=ZOgKTO612u1Fn7PB@casper.infradead.org \
--to=willy@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=rauji.raut@gmail.com \
--cc=syzbot+e295147e14b474e4ad70@syzkaller.appspotmail.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