mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mincore() should return EINVAL for length < 0
@ 2005-10-10 22:34 Badari Pulavarty
  0 siblings, 0 replies; only message in thread
From: Badari Pulavarty @ 2005-10-10 22:34 UTC (permalink / raw)
  To: lkml

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

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



[-- Attachment #2: mincore-fix.patch --]
[-- Type: text/x-patch, Size: 431 bytes --]

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-10-10 22:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-10 22:34 [PATCH] mincore() should return EINVAL for length < 0 Badari Pulavarty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®