mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Diego Woitasen <diego@woitasen.com.ar>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Use the tsk argument in init_new_context()
Date: Thu, 19 Jul 2007 17:42:38 -0700	[thread overview]
Message-ID: <20070719174238.fab0d079.akpm@linux-foundation.org> (raw)
In-Reply-To: <1183946108509-git-send-email-diego@woitasen.com.ar>

On Sun,  8 Jul 2007 22:55:08 -0300
Diego Woitasen <diego@woitasen.com.ar> wrote:

> Signed-off-by: Diego Woitasen <diego@woitasen.com.ar>
> ---
>  arch/i386/kernel/ldt.c   |    2 +-
>  arch/x86_64/kernel/ldt.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
> index e0b2d17..c2eb4fb 100644
> --- a/arch/i386/kernel/ldt.c
> +++ b/arch/i386/kernel/ldt.c
> @@ -96,7 +96,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>  
>  	init_MUTEX(&mm->context.sem);
>  	mm->context.size = 0;
> -	old_mm = current->mm;
> +	old_mm = tsk->mm;
>  	if (old_mm && old_mm->context.size > 0) {
>  		down(&old_mm->context.sem);
>  		retval = copy_ldt(&mm->context, &old_mm->context);
> diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
> index bc9ffd5..99a92ed 100644
> --- a/arch/x86_64/kernel/ldt.c
> +++ b/arch/x86_64/kernel/ldt.c
> @@ -100,7 +100,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
>  
>  	init_MUTEX(&mm->context.sem);
>  	mm->context.size = 0;
> -	old_mm = current->mm;
> +	old_mm = tsk->mm;
>  	if (old_mm && old_mm->context.size > 0) {
>  		down(&old_mm->context.sem);
>  		retval = copy_ldt(&mm->context, &old_mm->context);


When called from dup_mm(), `tsk' refers to the new task and `current'
refers to the old one.  I'd have expected this to crash during your testing?

  reply	other threads:[~2007-07-20  0:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09  1:55 Diego Woitasen
2007-07-20  0:42 ` Andrew Morton [this message]
2007-07-21  1:00   ` Diego Woitasen

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=20070719174238.fab0d079.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=diego@woitasen.com.ar \
    --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

Powered by JetHome