All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Dave Anderson <anderson@mclinux.com>
Cc: linux-kernel@vger.kernel.org, blinn@mclinux.com
Subject: Re: [BUG][PATCH] 2.4.* mlockall(MCL_FUTURE) is broken -- child inherits  VM_LOCKED
Date: Tue, 08 Jan 2002 13:55:43 -0800	[thread overview]
Message-ID: <3C3B6ADF.4AAABE58@zip.com.au> (raw)
In-Reply-To: <3C3B5D1B.45CBF593@mclinux.com>

Dave Anderson wrote:
> 
> In 2.4.*, mlockall(MCL_FUTURE) is erroneously inherited by child processes
> across fork() and exec():

The Linux manpage says that it is not inherited across either.

However SUS says that it is not inherited across exec, and
doesn't mention fork() at all.
http://www.opengroup.org/onlinepubs/007908799/xsh/mlockall.html

So...  Shouldn't we be clearing it in the exec() path?

> ...
> # diff -u linux/kernel/fork.c linux-2.4.17/kernel/fork.c
> --- linux/kernel/fork.c Tue Jan  8 15:11:13 2002
> +++ linux-2.4.17/kernel/fork.c  Tue Jan  8 15:12:26 2002
> @@ -219,6 +219,7 @@
>         init_rwsem(&mm->mmap_sem);
>         mm->page_table_lock = SPIN_LOCK_UNLOCKED;
>         mm->pgd = pgd_alloc(mm);
> +       mm->def_flags = 0;
>         if (mm->pgd)
>                 return mm;
>         free_mm(mm);
> 
> Note that it worked OK in 2.2 because mm->def_flags was explicitly cleared in
> mm_alloc(), which was called by both copy_mm() and exec_mmap().  But things
> were shuffled around a bit in 2.4, and it must have gotten lost in the
> translation...

um.  Is this correct?  It seems that we'll be clearing things
like VM_IO on device mappings across fork.  Bad.  Would an explicit
clear of VM_LOCKED be better here?  (Assuming we want to ignore SUS).

-

  reply	other threads:[~2002-01-08 22:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-08 20:56 [BUG][PATCH] 2.4.* mlockall(MCL_FUTURE) is broken -- child inherits VM_LOCKED Dave Anderson
2002-01-08 21:55 ` Andrew Morton [this message]
2002-01-08 22:18   ` Bruce Blinn
2002-01-08 22:39     ` Andrew Morton

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=3C3B6ADF.4AAABE58@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=anderson@mclinux.com \
    --cc=blinn@mclinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.