linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: "Christian Brauner" <brauner@kernel.org>,
	"Michael Kerrisk" <mtk.manpages@gmail.com>,
	linux-kernel@vger.kernel.org,
	"Коренберг Марк" <socketpair@gmail.com>,
	"Andrei Vagin" <avagin@openvz.org>,
	"Dmitry Safonov" <dima@arista.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Serge Hallyn" <serge@hallyn.com>,
	bugzilla-daemon@kernel.org, linux-api@vger.kernel.org
Subject: Re: vfork(2) behavior not consistent with fork(2)
Date: Wed, 06 Apr 2022 21:26:56 +0200	[thread overview]
Message-ID: <87k0c2qagv.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <f21a06dc-1e2a-87cd-59dc-e8d5245b0a50@gmail.com> (Alejandro Colomar's message of "Wed, 6 Apr 2022 21:22:13 +0200")

* Alejandro Colomar:

>> $ sudo ./vfork_newpid
>> vfork_newpid: PID: 8479
>> vfork_newpid: PID 8479 exiting after execve(2): Success
>> print_pid: PID 1 exiting. 
>
>
> I definitely think this is a kernel (or glibc) bug.
> execve(2) is supposed to _never_ return 0 (and errno 0).
> I submitted a new bug to discuss it.
>
> Please see <https://bugzilla.kernel.org/show_bug.cgi?id=215813>

It's not clear if this is valid.  The syscall function in glibc does not
protect the on-stack return address against overwriting, so it can't be
used to call SYS_vfork on x86.

Can you reproduce this with a true inline syscall, or the glibc vfork
function (which protects the return address)?

Thanks,
Florian


  reply	other threads:[~2022-04-06 20:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-215769-216477@https.bugzilla.kernel.org/>
     [not found] ` <bug-215769-216477-to2O9X1Knw@https.bugzilla.kernel.org/>
     [not found]   ` <4fb02f5f-60f9-42af-ddd5-fe5af877231f@gmail.com>
     [not found]     ` <20220404080519.pi6izyuop3mmdg2g@wittgenstein>
     [not found]       ` <ae2cbf67-aace-bc40-418e-7b41873f814a@gmail.com>
     [not found]         ` <20220406084613.3srklyt27qxcmrcx@wittgenstein>
2022-04-06 19:22           ` vfork(2) behavior not consistent with fork(2) (was: vfork(2) fails after unshare(CLONE_NEWTIME) (was: [Bug 215769] man 2 vfork() does not document corner case when PID == 1)) Alejandro Colomar
2022-04-06 19:26             ` Florian Weimer [this message]
2022-04-06 19:31               ` [Bug 215813] syscall(SYS_vfork) causes execve() to return 0. (was: vfork(2) behavior not consistent with fork(2)) Alejandro Colomar

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=87k0c2qagv.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=alx.manpages@gmail.com \
    --cc=arnd@arndb.de \
    --cc=avagin@openvz.org \
    --cc=brauner@kernel.org \
    --cc=bugzilla-daemon@kernel.org \
    --cc=dima@arista.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=serge@hallyn.com \
    --cc=socketpair@gmail.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).