From: Vyacheslav Dubeyko <slava@dubeyko.com>
To: Wenliang Fan <fanwlexca@gmail.com>
Cc: konishi.ryusuke@lab.ntt.co.jp, linux-nilfs@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/nilfs2: Integer overflow in nilfs_ioctl_wrap_copy()
Date: Mon, 30 Dec 2013 10:40:07 +0400 [thread overview]
Message-ID: <1388385607.3988.14.camel@slavad-ubuntu> (raw)
In-Reply-To: <1388197696-4648-1-git-send-email-fanwlexca@gmail.com>
Hi,
On Sat, 2013-12-28 at 10:28 +0800, Wenliang Fan wrote:
> The local variable 'pos' comes from userspace. If a large number was
> passed, there would be an integer overflow in the following line:
> pos += n;
>
> Signed-off-by: Wenliang Fan <fanwlexca@gmail.com>
> ---
> fs/nilfs2/ioctl.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
> index b44bdb2..a260a98 100644
> --- a/fs/nilfs2/ioctl.c
> +++ b/fs/nilfs2/ioctl.c
> @@ -65,6 +65,8 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
> ret = 0;
> total = 0;
> pos = argv->v_index;
> + if (pos > ULONG_MAX - argv->v_nmembs)
> + return -EINVAL;
I am slightly confused. Does this patch means that you refused previous
one? Or this patch is addition to the previous one?
You need to prepare next version of the patch or to prepare patch set
from two patches. And it makes sense to provide changelog of your work,
I think.
Thanks,
Vyacheslav Dubeyko.
> for (i = 0; i < argv->v_nmembs; i += n) {
> n = (argv->v_nmembs - i < maxmembs) ?
> argv->v_nmembs - i : maxmembs;
next prev parent reply other threads:[~2013-12-30 6:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-28 2:28 [PATCH] fs/nilfs2: Integer overflow in nilfs_ioctl_wrap_copy() Wenliang Fan
2013-12-30 6:40 ` Vyacheslav Dubeyko [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-12-20 7:46 Wenliang Fan
2013-12-20 8:23 ` Vyacheslav Dubeyko
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=1388385607.3988.14.camel@slavad-ubuntu \
--to=slava@dubeyko.com \
--cc=fanwlexca@gmail.com \
--cc=konishi.ryusuke@lab.ntt.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nilfs@vger.kernel.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