lkml.org 
[lkml]   [2005]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Coverity] Untrusted user data in kernel
Jan Kasprzak wrote:
> [...]
> + if (mem.len <= 0 || mem.addr < 0 || mem.len > 65536 || mem.addr > 65535
> + || mem.addr + mem.len > 65536)
> + return -EFAULT;

Just an extremely small nitpick. The conditions

mem.len > 65536 || mem.addr > 65535

aren't needed, because if one of them is true, then

mem.addr + mem.len > 65536

must be true also, since we've already asserted that len>0 and addr>=0.

This would be even simpler if len and addr were unsigned as they should
be, but that's probably not your fault :(

--
Paulo Marques - www.grupopie.com

"A journey of a thousand miles begins with a single step."
Lao-tzu, The Way of Lao-tzu
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.073 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site