Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2856343rwl; Mon, 27 Mar 2023 06:17:37 -0700 (PDT) X-Google-Smtp-Source: AK7set+9S0ApgPFOA98nm6yrv0G36LH4h9zBLw4nzHgfkAmShbLh/FbBXJkHep9XuMGRog45Pq3x X-Received: by 2002:a05:6a20:7b24:b0:db:a9e7:9bbb with SMTP id s36-20020a056a207b2400b000dba9e79bbbmr9344342pzh.48.1679923056963; Mon, 27 Mar 2023 06:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679923056; cv=none; d=google.com; s=arc-20160816; b=GVT8RBoyzWbYHSaVkAaqr4Z1ApZd7wWv7s2peDQkPo/NOnklZkPy7u5lw+gazqIM1e NZMiz9pOocYRQytSsRL9QchShujTjlHM4vSGV71jgP8MCxmSbNP3/I0joej9scY8oSHe glrLUwUcPoa8AZzjALrIMIm03cDEYRCwi9fWCOK+On8WcOh1fOLciSg/5V87ZOEvqvNP QWHRLk1ZKW1bp1y26hxpYCooamng1pfT2zAH6WbLjXliy8UxwcvDkUY0Cw2oHsYE85iW TQS8dPU2veACsiu0YGPqLCP/5vyM1911tqq0zg0sqtx1u3WkXw1spSwiHonOrdwzWeWO 9yoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=PMYbv6lzMtV9aBsvN9bUd8L45MF7C3r1CJYwE0yaT8c=; b=xOtHHMYldYMsH2PVzKMtHrg/tCiir4QuCw8J+wF+r7KQ+OQdWbiperRynFgUJdjHrl IGAY89wLe+PKzyZ/GIOpR4u861LU32YwNXI3FYimXHDHT5VCDDRGNzn8VQDvS+hoCCdL 4QnMpvSEpGbLthJHZfxxcVd1eC3pGMCbEmsYGS7fp2WO+UPrdIHksKgUu/sECAb5A88F ZlYeLifDBoJVdVtDgpMTYaYHpkYXuG/WKjdZnOumyrFFA32xfejU5cXZc/k83Cy9CVGh /pjs5+5mfKIBLOlzwQVpnrSEsMb9slcJ5jtRaNhc+Xaif/7waYqkkr/k74b7UvDsWQXp WWKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm1 header.b=dObTmFqW; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=M4Hh45eJ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d78-20020a621d51000000b00576fca27d92si11359949pfd.206.2023.03.27.06.17.23; Mon, 27 Mar 2023 06:17:36 -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=@tycho.pizza header.s=fm1 header.b=dObTmFqW; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=M4Hh45eJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232374AbjC0NQq (ORCPT + 99 others); Mon, 27 Mar 2023 09:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjC0NQp (ORCPT ); Mon, 27 Mar 2023 09:16:45 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FD281985; Mon, 27 Mar 2023 06:16:44 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7CC275C00F3; Mon, 27 Mar 2023 09:16:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 27 Mar 2023 09:16:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho.pizza; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1679923003; x=1680009403; bh=PM Ybv6lzMtV9aBsvN9bUd8L45MF7C3r1CJYwE0yaT8c=; b=dObTmFqWuQq4O1QxWL axiTetLUSGpUp88T5qYMZOgBlWuyrI3p91pD0WcrZxqJspmncBSXXdIA2RHvQzDo legvDcHDa2XA7ivgIJUGIzLyYVHzm92gQAK7nFvy9Xvvc3yCSXMzFrpjAymR7L8D cQblmLAFh/SjQcB2trKJnHHiKCWpDjXMfbZpydcg50g4i0qZ7Ehxv2p8PNPhaJrh cLKaI25cRC2+7vtK5so8eUy8XOpI35khdTpN9SuPofR+ojhwVOzmaE5FXVaVt+LL cNGhHD9GpGvlUMg33HncCt+dPBt0VEWvk+CWUt72E8yf0YyOfmlSTJT4DpaHUwXP o6Ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1679923003; x=1680009403; bh=PMYbv6lzMtV9a BsvN9bUd8L45MF7C3r1CJYwE0yaT8c=; b=M4Hh45eJ8jVZqVk+rC75IIspBdWrw VXTjZZJXIJMfei/INdp9skdKGBm0Nt8AjQTBWJuiRQnUFCs2hvZ7z/rNhYnu3G1Q N5ybBP7gPGr6btaD+U0r0cYJ084kUeVAfaqIJPO8E+ADG+MI/k8hp5XGTVL+1omP u0T9EGfNlZh6rSgi4EI2acuop2cJhgRjKPtc8BNqUFGouOV+fD9USxfy+qrWEjcw RDNs2/HRtEQLpcW2Zq4zGEbmnaGc5riNJRxU5vTZP4Sx1Tf6uB4H0sjkkB5IWt+D JLmlw1XixHPsqq1/qOn+561kJszua4nBou2ECKiVxNtn8WxQqD/MLc2Xw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehvddgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepvfihtghh ohcutehnuggvrhhsvghnuceothihtghhohesthihtghhohdrphhiiiiirgeqnecuggftrf grthhtvghrnhepueettdetgfejfeffheffffekjeeuveeifeduleegjedutdefffetkeel hfelleetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epthihtghhohesthihtghhohdrphhiiiiirg X-ME-Proxy: Feedback-ID: i21f147d5:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Mar 2023 09:16:41 -0400 (EDT) Date: Mon, 27 Mar 2023 07:16:39 -0600 From: Tycho Andersen To: Christian Brauner Cc: aloktiagi , viro@zeniv.linux.org.uk, willy@infradead.org, David.Laight@aculab.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, keescook@chromium.org, hch@infradead.org Subject: Re: [RFC v4 2/2] file, epoll: Implement do_replace() and eventpoll_replace() Message-ID: References: <20230324063422.1031181-2-aloktiagi@gmail.com> <20230324082344.xgze2vu3ds2kubcz@wittgenstein> <20230327090106.zylztuk77vble7ye@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 On Mon, Mar 27, 2023 at 07:06:46AM -0600, Tycho Andersen wrote: > On Mon, Mar 27, 2023 at 11:01:06AM +0200, Christian Brauner wrote: > > On Fri, Mar 24, 2023 at 07:43:13AM -0600, Tycho Andersen wrote: > > > Perhaps we could add a flag that people could set from SECCOMP_ADDFD > > > asking for this extra behavior? > > > > + if (fd > 0 && addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_EPOLL) { > > + /* > > + * - retrieve old struct file that addfd->fd refered to if any. > > + * - call your epoll seccomp api to update the references in the epoll instance > > + */ > > epoll_seccomp_notify() > > + } > > + > > + if (fd > 0 && addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_IO_URING) { > > + /* > > + * - call your io_uring seccomp api to update the references in the io_uring instance > > + */ > > io_uring_seccomp_notify() > > + } > > Looks reasonable to me, thanks. One change I might suggest is only using a single flag bit -- we don't need to consume all of seccomp's remaining flag bits with the various subsystems. If you want to do this logic for epoll, you almost certainly want it for io_uring, select, and whatever else is out there. Tycho