Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1305536pxb; Wed, 6 Apr 2022 14:25:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8lGRH2ClTvPoc97xWU1evtpBm81g5QHpGkbkHea2h6jiz3uD+mMa7v5xv6R8yXxbily9c X-Received: by 2002:a17:907:16a2:b0:6e0:dc75:eb5a with SMTP id hc34-20020a17090716a200b006e0dc75eb5amr9976680ejc.508.1649280339503; Wed, 06 Apr 2022 14:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649280339; cv=none; d=google.com; s=arc-20160816; b=u8h54K9kiInUBdETeBLO4PK5ru60eMBExpoA4GRIFmRfpNf7BWyIP/czPo538/8Om0 SJiAauEhp4pdhJoHhkv/PzrSYZktFbbLPOqlhJXLG1P9nofC8zABJG2ng5KD77YDmuEs ZmsgKfX+7VYUvMowKRspQrV920Ipd5DwHmacQIRIr/xlCGg/pr43H7SMt2SmLctCxorh XSjMr0ZAzCRqlhWM0Mjgv3HRgsrVl3Nt5565xFAhqXzDNerWWCEj8FwMt3UAcsv4Z6SB cn/xO8pODwAQAeWEQxYwVG1WTm0t34QomEQEBqMQyB8rIjqB8ftYwwzzpl9dH1eRW+a9 hpVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=scxp5+BwL528BisDUZBAca7//7rrtzFe/Mu5lq8LYmA=; b=t4tgkV1XiAuR1aMBWtrnn5VKU/ODbZptFWG+nI7f1C9AoVeqgyohSzsYEiAwzIcJsA gg1Aypfx0SZJbQ0iblKucGcDVL1dNLpkhpFFgaAJka5/VNO+4XLReYjKyerlA3+EIjvt YyKiU7r7aElxyonq/3lVixUXyPQ0TZoGkJrJXcr6vlM6m3o595ha11tbZkbwlBi1App7 lh2yVTnuRL/PeVCIIqn98zQyEhh3eQnGRU7AqJA/ADNAtVa8DtFQ9rqE22QCBz53pGtX QgMAOSJPAm0jTqvue23Vod6GRTr3Jb4ogVRqfUXEIL55f50YEfmeyfDa/JwPWboo6qcg F4QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=brPlc5BE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j20-20020a05640211d400b00418c2b5bf59si13128024edw.571.2022.04.06.14.25.13; Wed, 06 Apr 2022 14:25:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=brPlc5BE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235189AbiDFVAl (ORCPT + 99 others); Wed, 6 Apr 2022 17:00:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235064AbiDFVAa (ORCPT ); Wed, 6 Apr 2022 17:00:30 -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 189471C6EE8 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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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