Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2214016ybb; Mon, 30 Mar 2020 01:35:56 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvjzJ7RU2Y2/ctKn1457kiuJF0nwxL+abcNIElJxSGDh4ez0b6rEYmTmbFHfhgY9fQtGNWQ X-Received: by 2002:a54:4094:: with SMTP id i20mr6437887oii.141.1585557356799; Mon, 30 Mar 2020 01:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585557356; cv=none; d=google.com; s=arc-20160816; b=01uRSJL4W4xRWaJ1PWUdFSevdt0dYyHIpJKzEL7b4AwbKu3JdMq37796ZinkXtNrDO vSzNtlRvnc8X8wsKUoZ6aEt58Nj0ZXH6n0qdn6aXYue+m+v/qqZ1OW6B6J5Nb4p9wEJk /93ZThJHMmyDO3nnsyVV+coJ7jTwa/cKXduF7NSJrt9K0N3X1q8imZXRaegpLqNVSbfX fpnbWG8MmfhVgQDFzmBCsyyBFavRvRHcpkDKGt/vMBs3U/UljMgoN12Bm7qDq0hPQjGg WDS2gcOTFcOu3NuOpWG6sF1U4b7f6fzoPwR+VFJkDSM/4PYlrC9xICwSwgrMJtwMOxIm WWAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VI4VJLvwA2Wnz1xcO7Y+Io0RjGUfdGgCzJ2iSp2r2DU=; b=mGfaKDPLTx7O7TKDv6dhliTUiWZ56Uy1BfljW7DV+/hZeDE5of5y7Nj2V2OtiU144a alLdSqabrBwzNX9g1vdeeo6OkXPaghQ+tMQjapYwXP3/tXhfzxFNbb8i0IPyTqdjebiI heflmna/MMY5LdL77BMdPcFND8rZYKDkbKkNGK16oh0UacepY49CvLp01nSTFZaOhxuw /nGGLpE8lTSz4RpozKDqUnnv3K1e7SwSqaBjsxu6npFXWOvIIIBn8r0pMKdS/jg+gWpN +exYzV8Ge7xgoWq/lghTYnvjmKYRhCom4ydvaJAvqcmFwf7haomuq9CuIBJzyC5jtlNZ aTbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iTKn3CoZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c130si5859173oig.98.2020.03.30.01.35.44; Mon, 30 Mar 2020 01:35:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iTKn3CoZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729663AbgC3Ie6 (ORCPT + 99 others); Mon, 30 Mar 2020 04:34:58 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:34520 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729594AbgC3Ie5 (ORCPT ); Mon, 30 Mar 2020 04:34:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585557296; 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=VI4VJLvwA2Wnz1xcO7Y+Io0RjGUfdGgCzJ2iSp2r2DU=; b=iTKn3CoZXapbq49bu6BdujZ63BNuVMTASDQi53Sb/KRfXsKAnlLtu0w2LLe86R8Fuk4o8m SDO4NDDL7a8iWmTT5RBKLafolQ/s6rBNxbXw/o4bR79jYkGnJDhlZXu9dBIzheT16N74Rc 2sS3JH3vNhwWdVYpCRhJwHMsRC/CMXo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-191-VzhFc2_pNWWc7DodrKjNHA-1; Mon, 30 Mar 2020 04:34:52 -0400 X-MC-Unique: VzhFc2_pNWWc7DodrKjNHA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6191E8010C8; Mon, 30 Mar 2020 08:34:50 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.195.36]) by smtp.corp.redhat.com (Postfix) with SMTP id ACE89100EBAF; Mon, 30 Mar 2020 08:34:47 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 30 Mar 2020 10:34:50 +0200 (CEST) Date: Mon, 30 Mar 2020 10:34:46 +0200 From: Oleg Nesterov To: Kees Cook Cc: Adam Zabrocki , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Jann Horn , Andy Lutomirski , "Eric W. Biederman" , Bernd Edlinger Subject: Re: Curiosity around 'exec_id' and some problems associated with it Message-ID: <20200330083446.GA13522@redhat.com> References: <20200324215049.GA3710@pi3.com.pl> <202003291528.730A329@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202003291528.730A329@keescook> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/29, Kees Cook wrote: > > On Tue, Mar 24, 2020 at 10:50:49PM +0100, Adam Zabrocki wrote: > > > > In short, if you hold the file descriptor open over an execve() (e.g. share it > > with child) the old VM is preserved (refcounted) and might be never released. > > Essentially, mother process' VM will be still in memory (and pointer to it is > > valid) even if the mother process passed an execve(). This was true after e268337dfe26dfc7efd422a804dbb27977a3cccc, but please see 6d08f2c7139790c ("proc: make sure mem_open() doesn't pin the target's memory"), iir it was merged soon after the 1st commit. Oleg.