mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>, clameter@sgi.com
Subject: [PATCH] get_nodes should ignore invalid node
Date: Wed, 22 Aug 2007 10:07:14 +0800	[thread overview]
Message-ID: <1187748434.8474.20.camel@sli10-conroe.sh.intel.com> (raw)

get_nodes doesn't check if nodes in node mask are valid, cause a kernel
oops when an invalid node is used..

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

Index: linux/mm/mempolicy.c
===================================================================
--- linux.orig/mm/mempolicy.c	2007-07-25 09:14:33.000000000 +0800
+++ linux/mm/mempolicy.c	2007-08-21 13:15:41.000000000 +0800
@@ -850,6 +850,8 @@ static int get_nodes(nodemask_t *nodes, 
 	if (copy_from_user(nodes_addr(*nodes), nmask, nlongs*sizeof(unsigned long)))
 		return -EFAULT;
 	nodes_addr(*nodes)[nlongs-1] &= endmask;
+
+	nodes_and(*nodes, *nodes, node_online_map);
 	return 0;
 }
 

                 reply	other threads:[~2007-08-22  2:16 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=1187748434.8474.20.camel@sli10-conroe.sh.intel.com \
    --to=shaohua.li@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.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®