Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp934310ybe; Wed, 4 Sep 2019 09:52:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzocBEiFiqaidoiidA5rmA3KrwGYxL8v6c+oouCbW9LOEREc0cL4+hFvV8wNOc496rIwYjM X-Received: by 2002:a63:4f1f:: with SMTP id d31mr13815608pgb.265.1567615972498; Wed, 04 Sep 2019 09:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567615972; cv=none; d=google.com; s=arc-20160816; b=Z8+2+mmZMPrIquRHP4UZBRCTvSUMMCGpN4AI6sDH9RJdJ6B1uqhPorllMM4PyVON3q NMXS5BiU6gsNnhlbAUiIqXP6ABWXW5/2CvUEYdyRrcnJ+grw8SGfx6JUyOYYWxeOh94B M2l52GaomFaq8WK6yIWA2Czr4x4VnPrMzVp0Nf8zO7AWiCRr72TockvuIFgdSCmAhCGB d+L86hFD+Ox4RIH8qxSJO0wJX4LZb6bd4Zh1ueDvNuUtAYVXGPlxJhwetOzZCXSgKmgo jsjWyA51Mru7zjNfGaCnmZe+UP+F+oxom9OKuWEDzBQxSRKGMuESI5/nbPHjHa1Dp3Xs zeVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WZhwDl6poxhpjErg8726fERGH8TrIU1vOsYDyQkch3E=; b=qOam4Z6k486gdzHIt9XCMMUMqDROKXfMJSyHi/AwMgl+4EleNDpmdl4A+orEseI9RH s1YG+h4Wtz4vOArcmbMYaTfowQEUGnJYlDjqr7yvHYNSppnbwYZKgTlr/+c7wi2Z1c9w BMrIDMbqMaGtf6jv+5VbLR1z9l8D+iqdRfqJ7Nh2OzTQFKHgGznp6SY85MBShRtjViRf DksO8LRApKQo6m3zkLeIiZoKXlkac0cwxKELFkSyFjCp8VPlvSI4/Bg7CDh1g7KsFueg 8QtCNnzGW+jLKlCgSYo60xSxKzitXCjaqTts1kVq16jzueYKxOCYGxt420HyTO1kAWw6 Bf1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=i3Woe2pW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u14si10418842pfc.222.2019.09.04.09.52.33; Wed, 04 Sep 2019 09:52:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=i3Woe2pW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732306AbfIDQva (ORCPT + 99 others); Wed, 4 Sep 2019 12:51:30 -0400 Received: from mail-io1-f54.google.com ([209.85.166.54]:32806 "EHLO mail-io1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732212AbfIDQv3 (ORCPT ); Wed, 4 Sep 2019 12:51:29 -0400 Received: by mail-io1-f54.google.com with SMTP id m11so13743874ioo.0 for ; Wed, 04 Sep 2019 09:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WZhwDl6poxhpjErg8726fERGH8TrIU1vOsYDyQkch3E=; b=i3Woe2pWDCqAw20ncPSTH8Ql/DNWO3edrHq446JMjqWucW0BQjssI4ttLhKd71iIyA s4xgPPgqhtUZDObsdTA0/iwkPfmg+Uz/cfT/9iJpj/RDTX/MtG83BLLsK+bHQxU+LbCJ Jse0xUFXD6Uzij7kOt7TziTiqtDRxp8wvxVVPsLKaCquivp6GEMrHerFs7w64WsyQDoy Ki44kzBodecZCrKnR4RzT9Nw1C94M2ntE8SKSIbn+OzoGXMEuGDuYKmYPX6bb2yvC1lr ChOh5yXl2tF0pod2DjqiglMA155srRe6QOwrzQBKXSalbNM9bk2Hfr1AgrVFR7xavRyN 7J1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WZhwDl6poxhpjErg8726fERGH8TrIU1vOsYDyQkch3E=; b=G/4T782IExvz3TT3HG8+uvXZt7wm3ICRiNOnvWTPnuajrOBegDqrLmpJ19aRwT1WNo HyQMDOE4/zD5ad0EZvirCiZ/OkiCiLaPYPb/XdAWGCIimgL14J+gsmoydr/2r8FUNUhK ZZiF26pt6XzicehNK6uzvaqWQ7foo1OC9V3w6We82PMn6RcYckr9ggjtNhu5KrmppfGW oQqPfyDpQ8yvv6AWDVL69ZZxloarqe3BtJlzQ+6BuZC+lhdAWoM5mBJbP/p4s1EsVUPR cm/b3lYsOGSUObacilFUmfOaWgkxn4DVokGppNuny4h+ZOyHnnEITAK17COH6t3s1SYR hxRg== X-Gm-Message-State: APjAAAWLhQvIOgJgnkVoaUsOIXwNcykgzHI4rJz8nufNdwXm0JyntN9S utlPLXKcc0F3XvY+50MiQ5M11CV+dEEli7iR/M5P+g== X-Received: by 2002:a6b:6303:: with SMTP id p3mr5303269iog.169.1567615888614; Wed, 04 Sep 2019 09:51:28 -0700 (PDT) MIME-Version: 1.0 References: <20190820001805.241928-1-matthewgarrett@google.com> <20190820001805.241928-4-matthewgarrett@google.com> <3440.1567182506@warthog.procyon.org.uk> In-Reply-To: <3440.1567182506@warthog.procyon.org.uk> From: Matthew Garrett Date: Wed, 4 Sep 2019 09:51:16 -0700 Message-ID: Subject: Re: [PATCH V40 03/29] security: Add a static lockdown policy LSM To: David Howells Cc: James Morris , LSM List , Linux Kernel Mailing List , Linux API , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 30, 2019 at 9:28 AM David Howells wrote: > > Matthew Garrett wrote: > > > +static char *lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1] = { > > const char *const maybe? Seems reasonable. > > +static enum lockdown_reason lockdown_levels[] = {LOCKDOWN_NONE, > > + LOCKDOWN_INTEGRITY_MAX, > > + LOCKDOWN_CONFIDENTIALITY_MAX}; > > + > > const? > > Isn't this also a 1:1 mapping? Sorry, a 1:1 mapping to what? > > +static int lock_kernel_down(const char *where, enum lockdown_reason level) > > Is the last parameter the reason or the level? You're mixing the terms. Fair.