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 X-Spam-Level: X-Spam-Status: No, score=-4.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A5E9C433E4 for ; Wed, 26 Aug 2020 19:46:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CCAE2080C for ; Wed, 26 Aug 2020 19:46:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WFkrzFpr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbgHZTq3 (ORCPT ); Wed, 26 Aug 2020 15:46:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbgHZTq1 (ORCPT ); Wed, 26 Aug 2020 15:46:27 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B05D2C061756 for ; Wed, 26 Aug 2020 12:46:26 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id 67so1608973pgd.12 for ; Wed, 26 Aug 2020 12:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lIC466wcHw5fR4eYEVc57sBZjLUX/gzzPPg8yLp1ZZU=; b=WFkrzFpr1SUiFaPbGhhpAKHAmVxv3wzkj4tDR+4PHOR9/MlIRPYJGnmI664QGeO/Cx jh56BsF4d4+yUYLb3tteEQtrETtrsW7Vukw+0hQQ46Y1kVm7YzGQ12QR8x1BVWPj5ZyL 5rDrqojD9sPXkIKEP7O2wCAa1fCxfWjqV9Rc4= 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=lIC466wcHw5fR4eYEVc57sBZjLUX/gzzPPg8yLp1ZZU=; b=BKDAI66siV/Jb5UQFP+YXVuL6QgSXf5pSgN4fSbSTmIMn0byfYZu1yOgD/XsNydMHG 2KnAX5tAmiWrzRMQMIvV9lMPhH7eiQBc3Y1b8RUSMWJUkIhjYPgW5OY+Soqe9cuJVoIp ePSqQlVzFooAfnzeBz046/Dquv0EhxzKryMjvbAOLO+f1akuwcfRN/blL0bWi3GBatRF K26fw4hdF/iYqPAyNKBNAggjqrExV/ricNs4GACXgkJrr+IL42veYmYfFaE9TubT8x3Q cWnHZ9FJ2FZ5dBfZazyqIBNhKisSG+0pzGBbXdnppwUI51Bi8/q2Al+V3nnYU//wqMzG AB6w== X-Gm-Message-State: AOAM533djbmgrdIkqriIe2SQUDSVzgFuVOTIrgkWa72CVlrk25aCXNon YqKLfw1AXAjMQtoQQMNYl/E5sw== X-Google-Smtp-Source: ABdhPJzfdv5XUXwJl1UOhKF/pH+9I5ADCLKzvf0FKe3PbEuFazJPlW1HymFX95ObV8KRL+rwcPkouA== X-Received: by 2002:a62:5212:: with SMTP id g18mr8576508pfb.8.1598471186120; Wed, 26 Aug 2020 12:46:26 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id ds19sm2262912pjb.43.2020.08.26.12.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 12:46:25 -0700 (PDT) Date: Wed, 26 Aug 2020 12:46:24 -0700 From: Kees Cook To: Stefano Garzarella 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 2/3] io_uring: add IOURING_REGISTER_RESTRICTIONS opcode Message-ID: <202008261245.245E36654@keescook> References: <20200813153254.93731-1-sgarzare@redhat.com> <20200813153254.93731-3-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200813153254.93731-3-sgarzare@redhat.com> Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Thu, Aug 13, 2020 at 05:32:53PM +0200, Stefano Garzarella wrote: > +/* > + * io_uring_restriction->opcode values > + */ > +enum { > + /* Allow an io_uring_register(2) opcode */ > + IORING_RESTRICTION_REGISTER_OP, > + > + /* Allow an sqe opcode */ > + IORING_RESTRICTION_SQE_OP, > + > + /* Allow sqe flags */ > + IORING_RESTRICTION_SQE_FLAGS_ALLOWED, > + > + /* Require sqe flags (these flags must be set on each submission) */ > + IORING_RESTRICTION_SQE_FLAGS_REQUIRED, > + > + IORING_RESTRICTION_LAST > +}; Same thought on enum literals, but otherwise, looks good: Reviewed-by: Kees Cook -- Kees Cook