mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + mm-mempolicy-check-parameters-first-in-kernel_get_mempolicy.patch added to -mm tree
@ 2020-08-04  3:24 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-08-04  3:24 UTC (permalink / raw)
  To: haowenchao22, mm-commits


The patch titled
     Subject: mm/mempolicy.c: check parameters first in kernel_get_mempolicy
has been added to the -mm tree.  Its filename is
     mm-mempolicy-check-parameters-first-in-kernel_get_mempolicy.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-mempolicy-check-parameters-first-in-kernel_get_mempolicy.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-mempolicy-check-parameters-first-in-kernel_get_mempolicy.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Wenchao Hao <haowenchao22@gmail.com>
Subject: mm/mempolicy.c: check parameters first in kernel_get_mempolicy

Previous implementatoin calls untagged_addr() before error check, while if
the error check failed and return EINVAL, the untagged_addr() call is just
useless work.

Link: http://lkml.kernel.org/r/20200801090825.5597-1-haowenchao22@gmail.com
Signed-off-by: Wenchao Hao <haowenchao22@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/mempolicy.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/mm/mempolicy.c~mm-mempolicy-check-parameters-first-in-kernel_get_mempolicy
+++ a/mm/mempolicy.c
@@ -1632,11 +1632,11 @@ static int kernel_get_mempolicy(int __us
 	int uninitialized_var(pval);
 	nodemask_t nodes;
 
-	addr = untagged_addr(addr);
-
 	if (nmask != NULL && maxnode < nr_node_ids)
 		return -EINVAL;
 
+	addr = untagged_addr(addr);
+
 	err = do_get_mempolicy(&pval, &nodes, addr, flags);
 
 	if (err)
_

Patches currently in -mm which might be from haowenchao22@gmail.com are

mm-mempolicy-check-parameters-first-in-kernel_get_mempolicy.patch


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

only message in thread, other threads:[~2020-08-04  3:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04  3:24 + mm-mempolicy-check-parameters-first-in-kernel_get_mempolicy.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).