lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 20 Dec 2013 12:23:28 +0400
From:	Vyacheslav Dubeyko <slava@...eyko.com>
To:	Wenliang Fan <fanwlexca@...il.com>
Cc:	konishi.ryusuke@....ntt.co.jp, linux-nilfs@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs/nilfs2: Integer overflow in nilfs_ioctl_wrap_copy()

On Fri, 2013-12-20 at 15:46 +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;
> 

What about check before enter into the cycle? If you are talking about
possible huge number then you can receive huge number from userspace
before entering in the cycle.

Thanks,
Vyacheslav Dubeyko.

> Signed-off-by: Wenliang Fan <fanwlexca@...il.com>
> ---
>  fs/nilfs2/ioctl.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
> index b44bdb2..b2bac9a 100644
> --- a/fs/nilfs2/ioctl.c
> +++ b/fs/nilfs2/ioctl.c
> @@ -90,8 +90,13 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
>  		total += nr;
>  		if ((size_t)nr < n)
>  			break;
> -		if (pos == ppos)
> +		if (pos == ppos) {
> +			if (pos > ULONG_MAX - n) {
> +				ret = -EINVAL;
> +				break;
> +			}
>  			pos += n;
> +		}
>  	}
>  	argv->v_nmembs = total;
>  


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ