public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@gmail.com>
Cc: GOTO Masanori <gotom@sanori.org>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix sigaltstack corruption among cloned threads
Date: Mon, 13 Mar 2006 10:30:22 -0500	[thread overview]
Message-ID: <20060313153022.GP20301@devserv.devel.redhat.com> (raw)
In-Reply-To: <a36005b50603130716x4cc5306ex2f8ecf012ea052d1@mail.gmail.com>

On Mon, Mar 13, 2006 at 07:16:17AM -0800, Ulrich Drepper wrote:
> On 3/13/06, GOTO Masanori <gotom@sanori.org> wrote:
> > +        * sigaltstack should be cleared when CLONE_SIGHAND (and CLONE_VM) is
> > +        * specified.
> > +        */
> > +       if (clone_flags & CLONE_SIGHAND)
> > +               p->sas_ss_sp = p->sas_ss_size = 0;
> 
> I agree in general, but why base it on CLONE_SIGHAND? The problem
> results from using the same address space.  So it should be
> 
>   if (clone_flags & CLONE_VM)
> 
> The fact that both these flags are used at the same time in all cases
> today shouldn't hide the real reason for this requirement which is
> sharing the address space.

Because vfork also sets CLONE_VM and vfork isn't supposed to reset
alternate stack setting.  For vfork that's not a problem, as the parent task
will not continue until the vfork child execve's.  So, if you want to use
CLONE_VM bit, you'd need to use
	if ((clone_flags & (CLONE_VM | CLONE_VFORK)) == CLONE_VM)
		p->sas_ss_sp = p->sas_ss_size = 0;

	Jakub

  reply	other threads:[~2006-03-13 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-13  8:52 [PATCH] Fix sigaltstack corruption among cloned threads GOTO Masanori
2006-03-13 15:16 ` Ulrich Drepper
2006-03-13 15:30   ` Jakub Jelinek [this message]
2006-03-13 16:29     ` Ulrich Drepper

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=20060313153022.GP20301@devserv.devel.redhat.com \
    --to=jakub@redhat.com \
    --cc=akpm@osdl.org \
    --cc=drepper@gmail.com \
    --cc=gotom@sanori.org \
    --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