From: Paul Jackson <pj@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Paul Jackson <pj@sgi.com>,
Simon.Derr@bull.net, linux-kernel@vger.kernel.org,
clameter@sgi.com
Subject: [PATCH 02/03] Cpuset: unsafe mm reference fix
Date: Wed, 29 Mar 2006 01:11:14 -0800 [thread overview]
Message-ID: <20060329091114.14612.8784.sendpatchset@jackhammer.engr.sgi.com> (raw)
In-Reply-To: <20060329091108.14612.84403.sendpatchset@jackhammer.engr.sgi.com>
From: Paul Jackson <pj@sgi.com>
Fix unsafe reference to a tasks mm struct, by moving the
reference inside of a convenient nearby properly guarded
code block.
Signed-off-by: Paul Jackson <pj@sgi.com>
---
kernel/cpuset.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- 2.6.16-mm1.orig/kernel/cpuset.c 2006-03-27 08:44:26.165846244 -0800
+++ 2.6.16-mm1/kernel/cpuset.c 2006-03-27 08:44:27.405861502 -0800
@@ -1183,11 +1183,11 @@ static int attach_task(struct cpuset *cs
mm = get_task_mm(tsk);
if (mm) {
mpol_rebind_mm(mm, &to);
+ if (is_memory_migrate(cs))
+ do_migrate_pages(mm, &from, &to, MPOL_MF_MOVE_ALL);
mmput(mm);
}
- if (is_memory_migrate(cs))
- do_migrate_pages(tsk->mm, &from, &to, MPOL_MF_MOVE_ALL);
put_task_struct(tsk);
synchronize_rcu();
if (atomic_dec_and_test(&oldcs->count))
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.650.933.1373
next prev parent reply other threads:[~2006-03-29 9:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-29 9:11 [PATCH 01/03] Cpuset: task_lock comment fix Paul Jackson
2006-03-29 9:11 ` Paul Jackson [this message]
2006-03-29 9:11 ` [PATCH 03/03] Cpuset: memory migration interaction fix Paul Jackson
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=20060329091114.14612.8784.sendpatchset@jackhammer.engr.sgi.com \
--to=pj@sgi.com \
--cc=Simon.Derr@bull.net \
--cc=akpm@osdl.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