From: Dan Carpenter <dan.carpenter@oracle.com>
To: Kari Argillander <kari.argillander@gmail.com>
Cc: almaz.alexandrovich@paragon-software.com, ntfs3@lists.linux.dev
Subject: Re: [bug report] fs/ntfs3: integer overflow in ni_fiemap()
Date: Wed, 25 Aug 2021 11:35:28 +0300 [thread overview]
Message-ID: <20210825083527.GQ7722@kadam> (raw)
In-Reply-To: <20210825083340.zd2en66jqmohdy4u@kari-VirtualBox>
On Wed, Aug 25, 2021 at 11:33:40AM +0300, Kari Argillander wrote:
> On Wed, Aug 25, 2021 at 11:04:40AM +0300, Dan Carpenter wrote:
> > Hello Konstantin Komarov,
> >
> > The patch 4342306f0f0d: "fs/ntfs3: Add file operations and
> > implementation" from Aug 13, 2021, leads to the following
> > Smatch static checker warning:
> >
> > fs/ntfs3/frecord.c:1894 ni_fiemap()
> > warn: potential integer overflow from user 'vbo + len'
> >
> > fs/ntfs3/frecord.c
> > 1843 int ni_fiemap(struct ntfs_inode *ni, struct fiemap_extent_info *fieinfo,
> > 1844 __u64 vbo, __u64 len)
> >
> > "vbo" and "len" are u64 values which are controlled by the user from
> > ioctl_fiemap().
> >
> > I looked at how BTRFS does it and it uses the fiemap_prep() function.
>
> And we should too. This was already in my todo list. Just didn't
> notice real problem yet. I just though we should follow api as api
> stated
>
> Flag checking should be done at the beginning of the ->fiemap
> callback via the fiemap_prep() helper.
>
> Do you want to send a patch or do I? If I do it can I put reported-by
> from you?
Yes please, I'd appreciate the Reported-by tag.
regards,
dan carpenter
prev parent reply other threads:[~2021-08-25 8:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-25 8:04 [bug report] fs/ntfs3: integer overflow in ni_fiemap() Dan Carpenter
2021-08-25 8:33 ` Kari Argillander
2021-08-25 8:35 ` Dan Carpenter [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=20210825083527.GQ7722@kadam \
--to=dan.carpenter@oracle.com \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=kari.argillander@gmail.com \
--cc=ntfs3@lists.linux.dev \
/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