From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84AE9C7619A for ; Mon, 27 Mar 2023 13:16:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232350AbjC0NQq (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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