Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp186884img; Wed, 27 Mar 2019 20:17:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpwo/X5PEnpi7oX9YqA46aTosbPqNI53PmqTzgSaFI2vDCFYS58wwLk5Oyi8s7w7+3QNsz X-Received: by 2002:a17:902:4101:: with SMTP id e1mr41502889pld.25.1553743068841; Wed, 27 Mar 2019 20:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553743068; cv=none; d=google.com; s=arc-20160816; b=QKgpGeQrShApEw73mtvlcfiHj9bXBYcuREujRIxIDwMqsG5XIRXzQElvqJmVcT83K+ rs+za8tRcmiH+9TLsRc+V/xZCpRWpwDcS89JKouwzH7sHR+q7FQpgnQsNxfVgknNoDBo 2bEoFWFxfYd1VvwLL093jrzSzF33eTUSYyhKuGgY/hNEwsBLSsmkd62SwUckKWmvPNwk JTrGTLXTx9g+DoHeMqXCD56VEwuORREAMDvgvSC57zuaF/7JFnutuvYwUaXyWOpziXuR RhCl4UUxg62QKoDKifNbfdRKTLOrwGUDj5yq2WB+CHYlfJXpXGWdJX/2EUFiF6xtD/dq xc9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=4Kx4U9zQI7MAjC9wjCu1TFQ74iAGOuTWcgIUSU57JsA=; b=A7h5WEeT2XNVZ8m6Py885fWr1UgoGHD2Bp91bm15RFBq/N5pYO/KLDsOsb73iCvfak oABON70wgcEPFxj1kqQb0VsNcM69D3baO2q7vqhD72zT0vcsApSlTSGqVhH/K/JjyYd5 vZS1+ejRBoFjKKO0XcJtFyUNBN734MaRjrSXR3VsFG55Ubmr2AtxfrqarUq+ufidsWzI V92x1XeipagVBICG+5+uvvCrw/tCMBLEAJiCG/wPX7/5YaaCA5QF766cocDwRwWphqh/ WqtdEdVMMVLc2zOV+5ZGk5RT55S08qpdp3D3rcdxZv0NxdT9TcOK1tjf610vSGwibIeA wLbw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si21288237pla.312.2019.03.27.20.17.33; Wed, 27 Mar 2019 20:17:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728267AbfC1DQP (ORCPT + 99 others); Wed, 27 Mar 2019 23:16:15 -0400 Received: from namei.org ([65.99.196.166]:59014 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbfC1DQP (ORCPT ); Wed, 27 Mar 2019 23:16:15 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id x2S3Fkde027824; Thu, 28 Mar 2019 03:15:46 GMT Date: Thu, 28 Mar 2019 14:15:46 +1100 (AEDT) From: James Morris To: Andy Lutomirski cc: Stephen Hemminger , Linux API , Matthew Garrett , LSM List , LKML , David Howells , Alexei Starovoitov , Network Development , Chun-Yi Lee , Daniel Borkmann , Kees Cook , Will Drewry Subject: Re: [PATCH 23/27] bpf: Restrict kernel image access functions when the kernel is locked down In-Reply-To: Message-ID: References: <20190325220954.29054-1-matthewgarrett@google.com> <20190325220954.29054-24-matthewgarrett@google.com> <20190325164221.5d8687bd@shemminger-XPS-13-9360> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Mar 2019, Andy Lutomirski wrote: > > > > kernel_is_locked_down("ioperm") > > > > becomes > > > > kernel_is_locked_down(LOCKDOWN_IOPERM) > > > > and this function checks e.g. > > > > if (lockdown_polcy[id]) { > > fail or warn; > > } > > > > Thoughts? > > I'm concerned that this gives too much useless flexibility to > administrators and user code in general. If you can break kernel > integrity, you can break kernel integrity -- it shouldn't really > matter *how* you break it. OTOH, this seems like a combination of mechanism and policy. The 3 modes are a help here, but I wonder if they may be too coarse grained still, e.g. if someone wants to allow a specific mechanism according to their own threat model and mitigations. Secure boot gives you some assurance of the static state of the system at boot time, and lockdown is certainly useful (with or without secure boot), but it's not a complete solution to runtime kernel integrity protection by any stretch of the imagination. I'm concerned about it being perceived as such. I'm not sure how to think about it architecturally and how it fits as such in the mainline kernel. -- James Morris