lkml.org 
[lkml]   [2005]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] mincore() should return EINVAL for length < 0
From
Date
Hi,

Here is the simple patch to fix mincore() returning
wrong error. mincore(2) manpage says, it should
return EINVAL, if length is non-positive.

Bug details are in:

http://bugme.osdl.org/show_bug.cgi?id=4612

Thanks,
Badari


Signed-off-by: Badari Pulabarty <pbadari@us.ibm.com>
--- linux-2.6.14-rc3.org/mm/mincore.c 2005-10-10 17:14:30.000000000 -0700
+++ linux-2.6.14-rc3/mm/mincore.c 2005-10-10 17:26:52.000000000 -0700
@@ -115,7 +115,7 @@ asmlinkage long sys_mincore(unsigned lon
long error;

/* check the arguments */
- if (start & ~PAGE_CACHE_MASK)
+ if ((start & ~PAGE_CACHE_MASK) || ((ssize_t)len < 0))
goto einval;

limit = TASK_SIZE;
\
 
 \ /
  Last update: 2005-10-11 00:37    [W:0.032 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site