Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1352130rwb; Wed, 26 Jul 2023 11:06:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlE21Yb08OltAjYhnUIDvhaGRwVUsE6szKb3IC5lFSiGxUIlcqL12ij4bxWgCx5MI00/mhVn X-Received: by 2002:aa7:d314:0:b0:522:2a94:1ea4 with SMTP id p20-20020aa7d314000000b005222a941ea4mr2003495edq.2.1690394814386; Wed, 26 Jul 2023 11:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690394814; cv=none; d=google.com; s=arc-20160816; b=vg0DDeNjm5H+PWaNzclcjXyGSSg5SlY0xcrnVnCO+kYWhN4+RVBD4yhtQu64eMFpmA rdU0Kg7PJP4Y5RZcUlBP5mx0tZNct4wFV8haXYyvuAdNCdsLOJ1N8efcNQBxDaY6TNI4 wceONGGwZN68LeT0NfwtKfsbG5G1iYecikW398dmyZYfLvRt+dthMnf1T8NgQ1OMElHa LOsDoR18WoV+GIolOHrDejAaU2vCczEfeGHmwHCIWq+ojMZ5kgW2r9tHuxiFHFQhs3LV LygY7H25bhQzt/Iqyl5q39eGlNuUgt87heiJI0WjCEXrMWrpoPUteohqXbkn4WKNc74e mejg== 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=6+BtwAiVSxh1iYhM2LPLsKH6+zDmGG6P7lMP2V1Zi70=; fh=TJ8ddEvnfAxdc1khO1UijEsVlJ+I0CmJDtL8Iv30UIA=; b=IMi2HS86aVVFSGRy5Jh/m13yLeuat6yCFDKbETP3vTxdXZGjRrV1wa084FS0y/pH1X hIzijxj4d3meLD5nbTN7U139n+ljmjPHbSDJ7HDckFpafvjHoIWwGGijbaIRbJwNJWh6 OhlNMCrbLbBL2z944xe1HK/I0SuoA+Wjjaa9FLtQfV/8o5oK9GzkqfSeIxxZUqPXmHqV koi63OQSvFesSA3o349paQfMdfWm0A0aMC+wtVD1Ik3Vxhg2ECJ1saxTNJpHXWtoWA5w Bp2dwAXcHo8fU4EwWeucnGLRtShWXdNuvJJ7TiKWdMvivk6w6uJCVfgBrw5aBJhIwo82 o8lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anarazel.de header.s=fm3 header.b=Qmd4H+Br; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=rDnqFY0b; 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 a1-20020aa7d901000000b0051dd50eb02bsi10314142edr.5.2023.07.26.11.06.26; Wed, 26 Jul 2023 11:06:54 -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=@anarazel.de header.s=fm3 header.b=Qmd4H+Br; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=rDnqFY0b; 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 S230120AbjGZRqA (ORCPT + 99 others); Wed, 26 Jul 2023 13:46:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbjGZRp6 (ORCPT ); Wed, 26 Jul 2023 13:45:58 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5F712697; Wed, 26 Jul 2023 10:45:55 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 6C7493200958; Wed, 26 Jul 2023 13:45:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 26 Jul 2023 13:45:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; 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=fm3; t=1690393552; x=1690479952; bh=6+ BtwAiVSxh1iYhM2LPLsKH6+zDmGG6P7lMP2V1Zi70=; b=Qmd4H+Br8tMw1XghlU Nlz7bHPXrAx6O7RV5E6WKRL6rQQP51jw9IPDGgQwag+n2TQEAtFZeu+B4DkVRixu knbljF++UyO50c9qQcu39POEQdRSvN7SSKrqiRYeb9C7kJAjmG2fFMYqkuhu4GiD 6VCz+CUcl2MUy+kMtmsZhZ5ifKaav7aJaGHf56Yn82fgUkEAzFjgak/wYvduI1sG 6IF0ct+HP96ffssE6OE1JGDPOr25oJtN13dEqt4NBL53rvwAC2j2aDKigCuLANHh qmagOEN2ZyXd09Lq5nVCQbFaExvslxhr1v8z9FdOAR9NaHTjync2HAoe4yGmNKnB AZ2w== 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=fm3; t=1690393552; x=1690479952; bh=6+BtwAiVSxh1i YhM2LPLsKH6+zDmGG6P7lMP2V1Zi70=; b=rDnqFY0bc6eP7jdogZERouKz7ECYX 6nCbYyW334nUrGDCwxfK7/t5D6yySDQAmtx4tZu5+0F8dqDdh4YgaVnuHhHHpvRv 73SZ0NmZRL0fQmLeuEcMaZisoC4N+/Yx+OyTqT625Le6AZqzIGUCEAxAiO37HmA+ V007MCKdZ+uMeFf+HS0YTyOZY41MFohQV/7Si/H9ITky/9F9WHX9RVz7AB3ntGJJ h5JOpBGdJ2K4jjiqu5HQTyPL93LnAUhe7xSV1O6h0l9s5KN5hCknYIVymL4wERnT 72mJzFjvbKnSkDnHeN900WH0UYs/v5mviuONbcPLyBhBxLlMbXtle5yjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedriedvgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Jul 2023 13:45:51 -0400 (EDT) Date: Wed, 26 Jul 2023 10:45:49 -0700 From: Andres Freund To: Matteo Rizzo Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, axboe@kernel.dk, asml.silence@gmail.com, corbet@lwn.net, akpm@linux-foundation.org, keescook@chromium.org, ribalda@chromium.org, rostedt@goodmis.org, jannh@google.com, chenhuacai@kernel.org, gpiccoli@igalia.com, ldufour@linux.ibm.com, evn@google.com, poprdi@google.com, jordyzomer@google.com, jmoyer@redhat.com, krisman@suse.de Subject: Re: [PATCH v3 1/1] io_uring: add a sysctl to disable io_uring system-wide Message-ID: <20230726174549.cg4jgx2d33fom4rb@awork3.anarazel.de> References: <20230630151003.3622786-1-matteorizzo@google.com> <20230630151003.3622786-2-matteorizzo@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230630151003.3622786-2-matteorizzo@google.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Hi, On 2023-06-30 15:10:03 +0000, Matteo Rizzo wrote: > Introduce a new sysctl (io_uring_disabled) which can be either 0, 1, > or 2. When 0 (the default), all processes are allowed to create io_uring > instances, which is the current behavior. When 1, all calls to > io_uring_setup fail with -EPERM unless the calling process has > CAP_SYS_ADMIN. When 2, calls to io_uring_setup fail with -EPERM > regardless of privilege. Hm, is there a chance that instead of requiring CAP_SYS_ADMIN, a certain group could be required (similar to hugetlb_shm_group)? Requiring CAP_SYS_ADMIN could have the unintended consequence of io_uring requiring tasks being run with more privileges than needed... Or some other more granular way of granting the right to use io_uring? ISTM that it'd be nice if e.g. a systemd service specification could allow some services to use io_uring, without allowing it for everyone, or requiring to run services effectively as root. Greetings, Andres Freund