Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp237830pxa; Thu, 27 Aug 2020 00:19:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR22qs/3Au4metHmRJK2mM/jMrp2ZMc31UkBwYj4KZH5rePXkF6HraXHXYjhNJxJtLdcyN X-Received: by 2002:a17:906:341b:: with SMTP id c27mr20032073ejb.32.1598512760533; Thu, 27 Aug 2020 00:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598512760; cv=none; d=google.com; s=arc-20160816; b=V6aai5ZyhzPMdo41I/4QSwm93DWoetzb4ZWEArKNPiB4/K4a3HDv9Tk9S1G8RvuZY7 VChEvWA++64R+9peYBrt/ay3lw1xXvil3p+HbfRdpZcQP0gTZQ07ubvSjNjpEKI6fr0V XMMzNEILYcgwiZn4CQTOUWuqWUV1hCB19qoT6jmyRnNvLJbshO3dozY84+GEA5Oi4ZYb yzTpbz0XXBDdpxBXUQmNV385ZWj9BfdxKtp/PGeeQCWpTlFC8hZX9jEbMwFjAKCjuSr8 x5tDmVR4UNAchmT1SIK71DwfB0ASM1umid+2BIcJwSR0PP3xKiaMtx/iOl8e0PdFm2FE xikw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=u9fFbu1GhOR5EEBDVCiFc4v2JfgRv9dRTWq43a81ToQ=; b=QG6cLwwUUUMDaVuoY0R+FQTbhpEffJ0gzrlsOCA9Fquo2aSQ15GB7SQEXcqJPAN8AR C0eF844kcIyfldni4FNMPNc8CSWYeLnJeWR8RkltNM6QblXX8Jrnzvz1Sturl/NqzOzo z8FQlUbXwbmST5XWzvWknH0kuxdjKLuRb69UqQTZBMJwBh/ZI7Kvu24sB/yRPS7Z6jRD l+LRBCtgdS1G8Yy8nDwGewyg67yDBAHCQ/EMs66xvy9LwRuPqzn4/f7YPa/Xcs/zzvqP iAsQVxNl0auZLx0+Gyxi+59eu9yyPXEjDRQFmjvyN2slwRO4JUYzvxIGbrP4+GCDnVyg RiqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RGBDWIK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si1023572edt.107.2020.08.27.00.18.57; Thu, 27 Aug 2020 00:19:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RGBDWIK3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727913AbgH0HSQ (ORCPT + 99 others); Thu, 27 Aug 2020 03:18:16 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:41453 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726882AbgH0HSO (ORCPT ); Thu, 27 Aug 2020 03:18:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598512691; 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=u9fFbu1GhOR5EEBDVCiFc4v2JfgRv9dRTWq43a81ToQ=; b=RGBDWIK3G1NQQkSAwosQoT3Q5eSWHJy201C0S2AGNDU0gCkW+f9WfkL69xlIj1++3JQoCx pKTlR9dwzOjmcAcImxT0vWTNEWM/p5456/vkfwhwwoA3sfYF6h+YqZ+VVzGjHm4wfKiLOY 2kMHQSTJuQ9xPuZn0+I8NVoR3TuMTBk= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-455-OxBJ50QkOv-MIDhBb-qJgA-1; Thu, 27 Aug 2020 03:18:08 -0400 X-MC-Unique: OxBJ50QkOv-MIDhBb-qJgA-1 Received: by mail-wm1-f71.google.com with SMTP id z1so1800599wmk.1 for ; Thu, 27 Aug 2020 00:18:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=u9fFbu1GhOR5EEBDVCiFc4v2JfgRv9dRTWq43a81ToQ=; b=fQpPAywC0i/5f9wxE7479D5BcF1cqIrmqvwM0hujtcgn2uYPQHd8D0by+PqDzdpAAQ sFeLANC/AaCwDTKjQLOzZKz/SfXXCvXH5BmX6xnI0uMmTNdwc/C8Fo/tSxhHccqsjAJw cXanOpZg/c0S8o8vuuwyyVa/WheWW4gI8ZI5X85HwbSB+chm3OVoGAjlOSEuKR5/l450 /OaHk527XUqRwz735r/VxZjgPb195mSdBh4PNqxIAfXo48zgII7MNnpNTlDw3K41SaZH wz89CLNiN8ZsKU0AtQgHVRmMHtYpx9VsxftpJf6n35HQgnEOPAez2lIz05r9/niuepY6 lhtg== X-Gm-Message-State: AOAM533FX3bNR+kfuznHwUAm9CI64eqaLuewnG2rWmOx+cPvOC/7PkNs JPcRWdUywjam8qE8B3SIrcssH4i5VMwsGxcyMl+EI0EEPZrodrCVlSq4TPpghGo3jSpdcPumtvb a0pD5xjimvhvZPE63mIf7mORZ X-Received: by 2002:adf:b349:: with SMTP id k9mr13694175wrd.135.1598512687410; Thu, 27 Aug 2020 00:18:07 -0700 (PDT) X-Received: by 2002:adf:b349:: with SMTP id k9mr13694156wrd.135.1598512687137; Thu, 27 Aug 2020 00:18:07 -0700 (PDT) Received: from steredhat.lan ([5.180.207.22]) by smtp.gmail.com with ESMTPSA id s12sm3022065wmj.26.2020.08.27.00.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 00:18:06 -0700 (PDT) Date: Thu, 27 Aug 2020 09:18:02 +0200 From: Stefano Garzarella To: Kees Cook Cc: Jens Axboe , Christian Brauner , Jann Horn , Jeff Moyer , linux-fsdevel@vger.kernel.org, Sargun Dhillon , Alexander Viro , Kernel Hardening , Stefan Hajnoczi , linux-kernel@vger.kernel.org, Aleksa Sarai , io-uring@vger.kernel.org Subject: Re: [PATCH v4 3/3] io_uring: allow disabling rings during the creation Message-ID: <20200827071802.6tzntmixnxc67y33@steredhat.lan> References: <20200813153254.93731-1-sgarzare@redhat.com> <20200813153254.93731-4-sgarzare@redhat.com> <202008261248.BB37204250@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202008261248.BB37204250@keescook> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 26, 2020 at 12:50:31PM -0700, Kees Cook wrote: > On Thu, Aug 13, 2020 at 05:32:54PM +0200, Stefano Garzarella wrote: > > This patch adds a new IORING_SETUP_R_DISABLED flag to start the > > rings disabled, allowing the user to register restrictions, > > buffers, files, before to start processing SQEs. > > > > When IORING_SETUP_R_DISABLED is set, SQE are not processed and > > SQPOLL kthread is not started. > > > > The restrictions registration are allowed only when the rings > > are disable to prevent concurrency issue while processing SQEs. > > > > The rings can be enabled using IORING_REGISTER_ENABLE_RINGS > > opcode with io_uring_register(2). > > > > Suggested-by: Jens Axboe > > Signed-off-by: Stefano Garzarella > > Reviewed-by: Kees Cook > > Where can I find the io_uring selftests? I'd expect an additional set of > patches to implement the selftests for this new feature. Since the io_uring selftests are stored in the liburing repository, I created a new test case (test/register-restrictions.c) in my fork and I'll send it when this series is accepted. It's available in this repository: https://github.com/stefano-garzarella/liburing (branch: io_uring_restrictions) Thanks for the review, Stefano