Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1481407rwb; Wed, 26 Jul 2023 13:13:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlF5/tMSMixVjBrMzh+5+7p6kdLiFsPyN4AnEZwwmGt97X+LlFpRZMCh7jYeTgUaDLyc0M6M X-Received: by 2002:a05:6a20:4295:b0:133:80c8:7a9b with SMTP id o21-20020a056a20429500b0013380c87a9bmr3342150pzj.9.1690402436428; Wed, 26 Jul 2023 13:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690402436; cv=none; d=google.com; s=arc-20160816; b=eWqNnodGuhaUgZGh3O1D04WXxt0cZ0J+t3VzCtxxE7fKN79z6izCClf2oZ/DKp1yEI jZump51ItA9TeWEBX9pUyjsKkCc7VFCv/hu2OY2fjj2T+yudaWFhbaKG8+kRkGdfBpO4 jX0xEaHHB5IqUCsTgiqsITjd6j5APFAw/tuR62gVXNZ3sA8pYLWuRI7BC2Mrsvd1hLgc q11d45Ni8OoYGkXQwKciOn9PqbtEw4NKgVp0dXWWPmHihoIbZ6aI4q2hUNLCRePJvMqM ia3Stwk/1IxRyH0Fs9MW0ZErFKbr6uv7xycJ79epg67wVDhDxxUSwK6Ykieh4V7cxeT8 U7kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=mEpXvvU90l0RthnJ6+S/VSU0zkOQwcnlRrI1p7pRhb8=; fh=6qVOfGRfvmmnaOEWx8iVCrm4KrOQBbhwTw6BNkK6td4=; b=0kP2GAr9wxmqh0tYub/oxcJ6t8oNPI+ipwzpMiIqM3aw3foEsUxKTi/xuzw9W6gIfu caCFXvrnerznXDiFCy5ObObP+Fa8021JjwMNVr60HMPZtX6Vb0RKJLSvUHP41rTxMEcB fOQqVr3TEgqqfKhot2Ut+oqauozFI7/J/PrJ4SEr8s+u5+fXKmu0GhUPq2i5/4Jjqzoz G98MUuy3yQi/EHLrbXmG+DUlG1z1tEagJslCTBo4NZpsDXXO6ltJTsFO70l/KuyERG40 PQSXj7jxDnfptg7ZN+6Fh/Tvo0XC7gYcvUqoH2rYZaJ/x37ZRlkQ4foO+hLDUN04iyfm m/4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MAWCoHEY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cb11-20020a056a00430b00b00686e19d20cbsi26763pfb.115.2023.07.26.13.13.43; Wed, 26 Jul 2023 13:13:56 -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=@redhat.com header.s=mimecast20190719 header.b=MAWCoHEY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbjGZT5g (ORCPT + 99 others); Wed, 26 Jul 2023 15:57:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbjGZT5f (ORCPT ); Wed, 26 Jul 2023 15:57:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D51826AE for ; Wed, 26 Jul 2023 12:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690401408; 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: in-reply-to:in-reply-to:references:references; bh=mEpXvvU90l0RthnJ6+S/VSU0zkOQwcnlRrI1p7pRhb8=; b=MAWCoHEYEXAJL8+oiZpegYTnF7237W3Xzp7DE8VQOx3cpATNwkM0weMDpCVa15D9WD6Myg Rn5t82uFSRjU4vudwNbFEKAFzUpqBAIcTxMFq/7wHtTMVT5GWtgF1x21G9S01PL+M1+vqi AqEj5As7ZBDC9o27Jt5Z5GFvN/NoeGg= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-sAGTV80hP06kYxAGLDLjHg-1; Wed, 26 Jul 2023 15:56:42 -0400 X-MC-Unique: sAGTV80hP06kYxAGLDLjHg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BCA8D1C0904A; Wed, 26 Jul 2023 19:56:41 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26A082166B25; Wed, 26 Jul 2023 19:56:40 +0000 (UTC) From: Jeff Moyer To: Andres Freund Cc: Matteo Rizzo , 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, krisman@suse.de Subject: Re: [PATCH v3 1/1] io_uring: add a sysctl to disable io_uring system-wide References: <20230630151003.3622786-1-matteorizzo@google.com> <20230630151003.3622786-2-matteorizzo@google.com> <20230726174549.cg4jgx2d33fom4rb@awork3.anarazel.de> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Wed, 26 Jul 2023 16:02:26 -0400 In-Reply-To: <20230726174549.cg4jgx2d33fom4rb@awork3.anarazel.de> (Andres Freund's message of "Wed, 26 Jul 2023 10:45:49 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Hi, Andres, Andres Freund writes: > 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? That's fine with me, so long as there is still an option to completely disable 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. Do you have a proposal for how that would work? Why is this preferable to using a group? Cheers, Jeff