Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp238008pxk; Thu, 1 Oct 2020 00:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypoLrU8DJfzJSpTe64GMoHB6e75gPRzc06/tZPVCKoouSR9i5JliS9IzPkBzpMrwmN4c9g X-Received: by 2002:a17:906:1485:: with SMTP id x5mr6918349ejc.163.1601538515033; Thu, 01 Oct 2020 00:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601538515; cv=none; d=google.com; s=arc-20160816; b=SZGbZ4ZgufsbQSEYs/mI/7R5obU/KqjWJAD0aKlFbUgm6vGyYlMsDtVPDHtoGez5+s 6BOoM9yL05I2tN9m0pQDI5a7jn9hEVQ5vPde1jOs5DOSIy7jNUhIgd8v6MEsS5ycEycv xmMe2iknLLqoEBPjPiseozRtNut1ujzUcZ8AOIY3yZM3sFk9Bw747M9Wuo3kUA2hWzHZ liqB41ylydMa1BHSlg4Y3V5ffJvz0tNqprAlAsVLfoD8GAQ2FE4jJrUM5nOYJYoX09ai 968ziqhYEWg9V8K9f0V03U/4BBtHWd/Z4EffInfGJJyw4ACgszpskvTs272UWpUf0C00 7WwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:cc:dkim-signature; bh=xF7e0E8Lw4CA2Uq+qVpBw+cIQFKMIBUjuND9PoUrs5Y=; b=yV3H+lcAMZe5TypE7M+tqlhJgzIOQ8NIS4sCOVQZoktRrcMFGe23MeER+d/YwHOZQA QL9A0TpUP/rt7ft2MRNAYWp3evUW+b3sS0YBmXZVDUMHEhOm4mf34u4TIOeX+Q0vRG46 c0+72dBG30PzV3Vd53O391v1AF8Sqk1BTNUf+0ewBngYpTFN7Kr1Q77yCQSHEeddsNrS nojHfWlPRawn+JzBIiaM9ZrgaqHticX4epsC0C7TTw9jUsrHfbdH54zvSJE/IPXnx3r6 AGAsMhhjy4Tjt14P+AlGstUw2asNz+o8RJ6ZmYR8VEV4fkIPz9rZwIErFsEfO3JHaDSJ o2xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="d/vQ+VVk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si2905691ejm.360.2020.10.01.00.48.12; Thu, 01 Oct 2020 00:48:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="d/vQ+VVk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731390AbgJAHpY (ORCPT + 99 others); Thu, 1 Oct 2020 03:45:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbgJAHpY (ORCPT ); Thu, 1 Oct 2020 03:45:24 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95986C0613D0; Thu, 1 Oct 2020 00:45:23 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id t10so4474283wrv.1; Thu, 01 Oct 2020 00:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xF7e0E8Lw4CA2Uq+qVpBw+cIQFKMIBUjuND9PoUrs5Y=; b=d/vQ+VVk+keNzkTfJSJxtcXpSwp2e7QCaBNQZVU4obREwDbvYR4ZOkBAIn6nZtjLrb 3dRvKN+GZdP1oQFFW/WEgNG9Ppq4gVVv6NzUKiTksJwcvN9PabgGRW31N0rtN+ZwizBZ Ir7qV4dK/89jGgUAjfx/Dt5qCN9CBfJEHDXQ3wXfHiKFfYxmdygBYHRXbft2M6MJDZht 8MsO994BspQhR23fIhIiWfa0x2AEEtJL394LV/ThsCeCMiTFdFm/rX53wswTwkK2O5Xj iJx9UD43hnd5M2L/jQHIj83U3txiSLHzEMovktlDwd72Doib8y20ewhC18AZ/A7VLimt CJeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xF7e0E8Lw4CA2Uq+qVpBw+cIQFKMIBUjuND9PoUrs5Y=; b=r+gr5Iucm6an8QaDd2OH/4KKZ2LlWzlQHNhDfETH5cijOajO6q/8MIGxQXDxwRGSm1 oaURRn74f3eiCTQ17zvjTf9HptVGXZIGxleD3mWghbHIGjjPA4hmZeVeZh6hcK3GGWAi X2hCNwanJG+HDPu8t+KNGZn34O5p0RXIEqlD7YxeYz5wxpSlMoartzuUM6tnoxmC9mmt 7iShWOwlD1pTZNgTYGWFQzpvo7f61DxRnZxkHetcwSwILsoG38e4Jx9a5y+DbnZgr1HN JsSzSse4RosZ+J6+Ueybge1BiswOWPKLqcxLcfDE23WaXwb9j+0tfrcP5vQr6OLfaolk BbBQ== X-Gm-Message-State: AOAM531F2xAqba33+NEvTlXO06LeFhVo3Min8AVHOPVSH98neCb4hzXI MypRk8vzYsuko9DxO55hh0w= X-Received: by 2002:adf:dd44:: with SMTP id u4mr6973042wrm.22.1601538322276; Thu, 01 Oct 2020 00:45:22 -0700 (PDT) Received: from ?IPv6:2001:a61:2479:6801:d8fe:4132:9f23:7e8f? ([2001:a61:2479:6801:d8fe:4132:9f23:7e8f]) by smtp.gmail.com with ESMTPSA id u66sm7145534wmg.44.2020.10.01.00.45.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Oct 2020 00:45:21 -0700 (PDT) Cc: mtk.manpages@gmail.com, Sargun Dhillon , Kees Cook , Christian Brauner , linux-man , lkml , Aleksa Sarai , Jann Horn , Alexei Starovoitov , wad@chromium.org, bpf@vger.kernel.org, Song Liu , Daniel Borkmann , Andy Lutomirski , Linux Containers , Giuseppe Scrivano , Robert Sesek Subject: Re: For review: seccomp_user_notif(2) manual page To: Tycho Andersen References: <45f07f17-18b6-d187-0914-6f341fe90857@gmail.com> <20200930150330.GC284424@cisco> <8bcd956f-58d2-d2f0-ca7c-0a30f3fcd5b8@gmail.com> <20200930230327.GA1260245@cisco> From: "Michael Kerrisk (man-pages)" Message-ID: <8f20d586-9609-ef83-c85a-272e37e684d8@gmail.com> Date: Thu, 1 Oct 2020 09:45:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200930230327.GA1260245@cisco> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/1/20 1:03 AM, Tycho Andersen wrote: > On Wed, Sep 30, 2020 at 10:34:51PM +0200, Michael Kerrisk (man-pages) wrote: >> Hi Tycho, >> >> Thanks for taking time to look at the page! >> >> On 9/30/20 5:03 PM, Tycho Andersen wrote: >>> On Wed, Sep 30, 2020 at 01:07:38PM +0200, Michael Kerrisk (man-pages) wrote: [...] >>>> ┌─────────────────────────────────────────────────────┐ >>>> │FIXME │ >>>> ├─────────────────────────────────────────────────────┤ >>>> │Interestingly, after the event had been received, │ >>>> │the file descriptor indicates as writable (verified │ >>>> │from the source code and by experiment). How is this │ >>>> │useful? │ >>> >>> You're saying it should just do EPOLLOUT and not EPOLLWRNORM? Seems >>> reasonable. >> >> No, I'm saying something more fundamental: why is the FD indicating as >> writable? Can you write something to it? If yes, what? If not, then >> why do these APIs want to say that the FD is writable? > > You can't via read(2) or write(2), but conceptually NOTIFY_RECV and > NOTIFY_SEND are reading and writing events from the fd. I don't know > that much about the poll interface though -- is it possible to > indicate "here's a pseudo-read event"? It didn't look like it, so I > just (ab-)used POLLIN and POLLOUT, but probably that's wrong. I think the POLLIN thing is fine. So, I think maybe I now understand what you intended with setting POLLOUT: the notification has been received ("read") and now the FD can be used to NOTIFY_SEND ("write") a response. Right? If that's correct, I don't have a problem with it. I just wonder: is it useful? IOW: are there situations where the process doing the NOTIFY_SEND might want to test for POLLOUT because the it doesn't know whether a NOTIFY_RECV has occurred? Thanks, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/