From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8ABAC433EF for ; Wed, 6 Apr 2022 20:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231740AbiDFVAv (ORCPT ); Wed, 6 Apr 2022 17:00:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234594AbiDFVAb (ORCPT ); Wed, 6 Apr 2022 17:00:31 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AEE6D1C8DA6 for ; Wed, 6 Apr 2022 12:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649273248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=scxp5+BwL528BisDUZBAca7//7rrtzFe/Mu5lq8LYmA=; b=brPlc5BEGJUNG3ngDee4qEa8jBxEPXZVy+T/0CTkDw81VkFRbfcKK3hw9pmP+i9ngAfmbn k7q//kI6iTcBygYVYoo1ZOPpqRpPv2BId10MLJxk8LQlxKSNJZypn0sfTzZWEwHM8r4cG9 CcmwRlPMDSBeramcbfFA0llIymyuGa4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-355-Iurfq8FHNgKHHKeXZdFWMA-1; Wed, 06 Apr 2022 15:27:24 -0400 X-MC-Unique: Iurfq8FHNgKHHKeXZdFWMA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D53AB1010360; Wed, 6 Apr 2022 19:27:10 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 047EC40D1DD; Wed, 6 Apr 2022 19:26:59 +0000 (UTC) From: Florian Weimer To: Alejandro Colomar Cc: Christian Brauner , Michael Kerrisk , linux-kernel@vger.kernel.org, =?utf-8?B?0Jo=?= =?utf-8?B?0L7RgNC10L3QsdC10YDQsyDQnNCw0YDQug==?= , Andrei Vagin , Dmitry Safonov , Thomas Gleixner , Arnd Bergmann , Serge Hallyn , bugzilla-daemon@kernel.org, linux-api@vger.kernel.org Subject: Re: vfork(2) behavior not consistent with fork(2) References: <4fb02f5f-60f9-42af-ddd5-fe5af877231f@gmail.com> <20220404080519.pi6izyuop3mmdg2g@wittgenstein> <20220406084613.3srklyt27qxcmrcx@wittgenstein> Date: Wed, 06 Apr 2022 21:26:56 +0200 In-Reply-To: (Alejandro Colomar's message of "Wed, 6 Apr 2022 21:22:13 +0200") Message-ID: <87k0c2qagv.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org * 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 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