mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Badari Pulavarty <pbadari@us.ibm.com>
To: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] mincore() should return EINVAL for length < 0
Date: Mon, 10 Oct 2005 15:34:17 -0700	[thread overview]
Message-ID: <1128983657.4896.25.camel@localhost.localdomain> (raw)

[-- 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;

                 reply	other threads:[~2005-10-10 22:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1128983657.4896.25.camel@localhost.localdomain \
    --to=pbadari@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®