Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2448102ybg; Thu, 24 Oct 2019 09:48:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6ojb6m7IW7cXhIomGH35TCPyk3AiLTgN0elBwyRyfR8bwxLrKmWnhwcP2tyqeGBkgb/PN X-Received: by 2002:a17:906:1ec6:: with SMTP id m6mr38301879ejj.6.1571935731747; Thu, 24 Oct 2019 09:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571935731; cv=none; d=google.com; s=arc-20160816; b=N2+emUS+NZX8eeMpfY67O7t3oJS8kEI1yhkNIKddcOUTRKdkeTqXqE2RQFvapIAvhA gyWi0Bw/0NQPnFOfCt6IxZmvr3tdAbzXY0YUSOznD85cZI8cA7CLmHR5WIz09dOkW7RK wiDLgooJxVLdLV31Jvq+vpF8OozsvZKSlyvJWF3EGDPQaYYQmo5yHrWA7z5Ht+gV2Yn+ X4parzcoYtfszhZjYvz6Wc5aRdYO4CZtJC7teuSlD9x+wdII0u5pCpiEc/Nd8K7qIIAL Z6GUIuyTZQ0S/70SEni2DdBTCNahabAiWcfUTvJmoDqs5obrvXxRw5pInSi9+Slr2b0R 6kpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9uVEepBOq08pJMbDSOkJFrN87N15F3Iw6wxc0N8M1KE=; b=ixfoSOG3lDG9S7vj900w8uZYT84+yYmrUOFzzHp/hdOjKup2qwBXGCPneYrrsBVGZQ Km5Pta5aQlLWbTUNkoNYZzuWkzsvUYCsvODtuBZ9fs/bEt/Z382XCB/sXrAjX3WBLGfJ qd54xJKMSyj6t7D4CHTaQeljUK5lq7lTWdmPBziUz1OHtOf2R0fDfejTo7+OnP8I645W +a1cCG+GOunclq9beLNx5+mdNF3o3HckzAx2PlTRcqtgdkChFUoyvE/nPs6J2e2fKI3T FL9c+cDtdLaqdhrGffaCYAxkJSYkURVFAJXsgcRpinAeGsV7yW9BKVT9+tmwsolVgOq2 EBJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Teffjk3S; 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 f27si7244493ejb.310.2019.10.24.09.48.27; Thu, 24 Oct 2019 09:48:51 -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=Teffjk3S; 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 S2392743AbfJWX1O (ORCPT + 99 others); Wed, 23 Oct 2019 19:27:14 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:54841 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731522AbfJWX1O (ORCPT ); Wed, 23 Oct 2019 19:27:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571873232; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9uVEepBOq08pJMbDSOkJFrN87N15F3Iw6wxc0N8M1KE=; b=Teffjk3SEVn7uJbp6312lwyk55H9B8b02gUluVURJm7a8+4YX4lW7t9D4QsKoPcdpBWzzU DqBvtxHh+Yr2YWEY3JjSMI1uvWH/jvVmocjmuWpbZ/7djSA2a3wqtjkfsZ9aEadw1aaqEB ngw/P4jF4l/fVBc04zomtcgtTy9CO1U= 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-258-X7Vm8hDlPiavQGUliB1acg-1; Wed, 23 Oct 2019 19:27:11 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F8C71005509; Wed, 23 Oct 2019 23:27:09 +0000 (UTC) Received: from mail (ovpn-123-192.rdu2.redhat.com [10.10.123.192]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F342E5C1D4; Wed, 23 Oct 2019 23:27:08 +0000 (UTC) Date: Wed, 23 Oct 2019 19:27:08 -0400 From: Andrea Arcangeli To: Andy Lutomirski Cc: Andy Lutomirski , Jann Horn , Daniel Colascione , Linus Torvalds , Pavel Emelyanov , Lokesh Gidra , Nick Kralevich , Nosh Minwalla , Tim Murray , Mike Rapoport , Linux API , LKML , "Dr. David Alan Gilbert" Subject: Re: [PATCH 3/7] Add a UFFD_SECURE flag to the userfaultfd API. Message-ID: <20191023232708.GA433@redhat.com> References: <20191023224110.GE9902@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: X7Vm8hDlPiavQGUliB1acg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 23, 2019 at 04:01:53PM -0700, Andy Lutomirski wrote: > Delivering events through read() is just fine. The problem is when > delivering an event does more than just returning bytes. As far as > I=E2=80=99ve noticed, uffd=E2=80=99s read() just returns bytes as long as= FORK is > disabled. Yes, fork is the only case where read doesn't return bytes. Moving only the fd creation to a separate syscall would then avoid involuntary creation of the fd.