Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19280473rwd; Wed, 28 Jun 2023 07:23:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IVvOvVeZvZOJKsmmvX28hwk5QFlqbgG1jWmQnuEOpcoQ6DW80NY8LBa4FSxVTTUx6D+P7 X-Received: by 2002:a05:6a20:8411:b0:10c:4c76:e909 with SMTP id c17-20020a056a20841100b0010c4c76e909mr28530313pzd.8.1687962197182; Wed, 28 Jun 2023 07:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687962197; cv=none; d=google.com; s=arc-20160816; b=bLze+6biNnfarDilLJoRGRDnDsES/RBQ1MQu33b9FRlxnVdnrQRXYhGsBJqT814rvg mhnkf5+T44pzXfHDFp71yNWG/sYUzSvrN/GV+wP3/dpu53rPSXFFX7bN0+jweEF5i/Ld Vv1ru6jTuNCRBW7izJxxKWRU2LeJKY1ZUi0tKjijRna6sK+QRdE5l+L7tOmpEgM4N81t lJavanU1OPLsNJq0TeJTznsXQBsYMlugPtpSQTYdWFuDZIfWvMqKHZKRoYdLwfqYjE5R mft+U66CAKoumm9QFUhKP/PlIorr9snspoPU1yZQPd2YD8906UUt1a/GpbMde/gw2PFq uoPQ== 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:dkim-signature; bh=VkBXGlD0oggkcayYs7pBu1iDrnzl5z5B5f3CsfkM3Qk=; fh=hbKZZGZjvGRyB4mXGgQXrvbQVMr9mHRxSxNQKuyZrzY=; b=yV8QaN40wFBy7KHIZ8jdpVUVgLAWwb7AHhnaEgCSZ0rPjLXLPTxoUxt7SMcL+pe0vI jkecCFKE06uuB2qoLF//+9opN99oLhgio2Kem9ELxwGk8UNkWPqQStpFm0T9cC3pMybl 0AaF12c8OloWFxnzM1rp2GSxrw2PEUCQ3O3fyKfQAjPwbwb2D68HpZB01a6b+VEx7cK6 cOU84xvxjkvOFCSe1Lun+I2f8cKPCXhHQesukr8f3s5JofuCqTvDRy0SZI+UhLn3SxPF bj7Y0sMc8x7UnGbbecP5ypUJ0GbLT9iapZ6dOsn7efSINq45edTjnhkXZntS8wOZEpOU QzlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=vmxpqRGH; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=E3b6Hytd; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a655189000000b00534866eb2c2si9199056pgq.835.2023.06.28.07.23.04; Wed, 28 Jun 2023 07:23:17 -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=@suse.de header.s=susede2_rsa header.b=vmxpqRGH; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=E3b6Hytd; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232329AbjF1Nup (ORCPT + 99 others); Wed, 28 Jun 2023 09:50:45 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:58426 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjF1Nuk (ORCPT ); Wed, 28 Jun 2023 09:50:40 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C56542189A; Wed, 28 Jun 2023 13:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687960238; h=from:from:reply-to: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=VkBXGlD0oggkcayYs7pBu1iDrnzl5z5B5f3CsfkM3Qk=; b=vmxpqRGHSrIk0MJ6BIwhVcjDHN0kyaV/LpTIdBczjKL+pdL5PQUEN48KMitsw+o1GEb/J2 lW/ghisQa6LkuOEA8ULyHfIRoWy0zTPpIkNhokT4bn9a8qnLCCgoUQMm2NbaEBZvyeI6NG mZX8D69IhFSSTCybMcSXDW0yNpbbmZQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687960238; h=from:from:reply-to: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=VkBXGlD0oggkcayYs7pBu1iDrnzl5z5B5f3CsfkM3Qk=; b=E3b6HytdPIOXwgM/OFchWEnEhNlTxHFVElAkORBeleDLqTurnRzWlloGvN1Z9EZDazaupL m8ES9d3VFhNV+QBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 85150138E8; Wed, 28 Jun 2023 13:50:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CsbhGq46nGQgDAAAMHmgww (envelope-from ); Wed, 28 Jun 2023 13:50:38 +0000 From: Gabriel Krisman Bertazi To: Matteo Rizzo Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, jordyzomer@google.com, evn@google.com, poprdi@google.com, corbet@lwn.net, axboe@kernel.dk, asml.silence@gmail.com, akpm@linux-foundation.org, keescook@chromium.org, rostedt@goodmis.org, dave.hansen@linux.intel.com, ribalda@chromium.org, chenhuacai@kernel.org, steve@sk2.org, gpiccoli@igalia.com, ldufour@linux.ibm.com Subject: Re: [PATCH 1/1] Add a new sysctl to disable io_uring system-wide References: <20230627120058.2214509-1-matteorizzo@google.com> <20230627120058.2214509-2-matteorizzo@google.com> Date: Wed, 28 Jun 2023 09:50:37 -0400 In-Reply-To: <20230627120058.2214509-2-matteorizzo@google.com> (Matteo Rizzo's message of "Tue, 27 Jun 2023 12:00:58 +0000") Message-ID: <87ilb7ofv6.fsf@suse.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matteo Rizzo writes: > diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst > index d85d90f5d000..3c53a238332a 100644 > --- a/Documentation/admin-guide/sysctl/kernel.rst > +++ b/Documentation/admin-guide/sysctl/kernel.rst > @@ -450,6 +450,20 @@ this allows system administrators to override the > ``IA64_THREAD_UAC_NOPRINT`` ``prctl`` and avoid logs being flooded. > > > +io_uring_disabled > +========================= > + > +Prevents all processes from creating new io_uring instances. Enabling this > +shrinks the kernel's attack surface. > + > += ============================================================= > +0 All processes can create io_uring instances as normal. This is the default > + setting. > +1 io_uring is disabled. io_uring_setup always fails with -EPERM. Existing > + io_uring instances can still be used. > += ============================================================= I had an internal request for something like this recently. If we go this route, we could use a intermediary option that limits io_uring to root processes only. -- Gabriel Krisman Bertazi