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=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 44D92C48BD6 for ; Wed, 26 Jun 2019 20:23:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 216212085A for ; Wed, 26 Jun 2019 20:23:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726455AbfFZUXZ (ORCPT ); Wed, 26 Jun 2019 16:23:25 -0400 Received: from namei.org ([65.99.196.166]:48562 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfFZUXZ (ORCPT ); Wed, 26 Jun 2019 16:23:25 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id x5QKMlwI029314; Wed, 26 Jun 2019 20:22:47 GMT Date: Thu, 27 Jun 2019 06:22:47 +1000 (AEST) From: James Morris To: Andy Lutomirski cc: Matthew Garrett , linux-security@vger.kernel.org, LKML , Linux API , David Howells , Alexei Starovoitov , Matthew Garrett , Network Development , Chun-Yi Lee , Daniel Borkmann , linux-security-module@vger.kernel.org Subject: Re: [PATCH V33 24/30] bpf: Restrict bpf when kernel lockdown is in confidentiality mode In-Reply-To: Message-ID: References: <20190621011941.186255-1-matthewgarrett@google.com> <20190621011941.186255-25-matthewgarrett@google.com> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org [Adding the LSM mailing list: missed this patchset initially] On Thu, 20 Jun 2019, Andy Lutomirski wrote: > This patch exemplifies why I don't like this approach: > > > @@ -97,6 +97,7 @@ enum lockdown_reason { > > LOCKDOWN_INTEGRITY_MAX, > > LOCKDOWN_KCORE, > > LOCKDOWN_KPROBES, > > + LOCKDOWN_BPF, > > LOCKDOWN_CONFIDENTIALITY_MAX, > > > --- a/security/lockdown/lockdown.c > > +++ b/security/lockdown/lockdown.c > > @@ -33,6 +33,7 @@ static char *lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1] = { > > [LOCKDOWN_INTEGRITY_MAX] = "integrity", > > [LOCKDOWN_KCORE] = "/proc/kcore access", > > [LOCKDOWN_KPROBES] = "use of kprobes", > > + [LOCKDOWN_BPF] = "use of bpf", > > [LOCKDOWN_CONFIDENTIALITY_MAX] = "confidentiality", > > The text here says "use of bpf", but what this patch is *really* doing > is locking down use of BPF to read kernel memory. If the details > change, then every LSM needs to get updated, and we risk breaking user > policies that are based on LSMs that offer excessively fine > granularity. Can you give an example of how the details might change? > I'd be more comfortable if the LSM only got to see "confidentiality" > or "integrity". These are not sufficient for creating a useful policy for the SELinux case. -- James Morris