Re: [patch 1/2] vhost: potential integer overflows

2010-10-12 Thread Michael S. Tsirkin
On Mon, Oct 11, 2010 at 07:22:57PM +0200, Dan Carpenter wrote: I did an audit for potential integer overflows of values which get passed to access_ok() and here are the results. Signed-off-by: Dan Carpenter erro...@gmail.com diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index

Re: [patch 1/2] vhost: potential integer overflows

2010-10-12 Thread Dan Carpenter
On Tue, Oct 12, 2010 at 02:25:48PM +0200, Michael S. Tsirkin wrote: As far as I can see, maximum value for num is 64K - 1: if (!s.num || s.num 0x || (s.num (s.num - 1))) { r = -EINVAL; break; } How

[patch 1/2] vhost: potential integer overflows

2010-10-11 Thread Dan Carpenter
I did an audit for potential integer overflows of values which get passed to access_ok() and here are the results. Signed-off-by: Dan Carpenter erro...@gmail.com diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index dd3d6f7..c2aa12c 100644 --- a/drivers/vhost/vhost.c +++

Re: [patch 1/2] vhost: potential integer overflows

2010-10-11 Thread Al Viro
On Mon, Oct 11, 2010 at 07:22:57PM +0200, Dan Carpenter wrote: I did an audit for potential integer overflows of values which get passed to access_ok() and here are the results. FWIW, UINT_MAX is wrong here. What you want is maximal size_t value. Signed-off-by: Dan Carpenter