Received: by 10.213.65.68 with SMTP id h4csp1340167imn; Sun, 8 Apr 2018 01:01:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx484oO9WfEs0bFjrJPGSk73FpRDlr21UHzneBMjQ2atFtueI6/t6+dYs69cRaKM6nCF6Tzlz X-Received: by 10.99.6.198 with SMTP id 189mr22500236pgg.131.1523174473177; Sun, 08 Apr 2018 01:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523174473; cv=none; d=google.com; s=arc-20160816; b=Ld9raxASPLfQQuRwJEXpG4qQAzsFbifDd99Xd7ev2oS5Q5QcMJTcN6uWpTofGsRuhE d6q8bm/n9qtKNtMIUtWwVS3vNOCM5pGt2aYxzCu7RhGelQgZF/2ftmQ8CcGLHWXeQv/B p9SzNha3NjC/ogwa41VgejDJzgjjS9+/NITIrQK6LycR2CihGrU+JLhB/eqVXkDghIn+ dviiAMnhmLln8DMK23PNuYwglPGFo1nDZFSCHb3os3DmgL52XGfOR+BhJIpE9w6qe61c rcsoTNDcrgCVnxNKTnezFMlb6RHczpzbETA0PjKywDUFI3ummkUG5Vv9hQPg4Wfvjjsq ABvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=nGoFMcTrcd2g77s680GoA0wKMU5vdzuWHC07S72uY2E=; b=bHaTUaGAkUNQWXP6u3xmsoDLqInyuYxlvkld/A2NxZMAmjyPt0gM7SJYAlvoV/fLE4 jy5f9AzWV22RiyPcPVxv/afL9+Z0IouSnbBulwOKyGNXNKBF787+VI19kxdXuHN6eOu4 j+lCtYwwbNzVgptXP5if7IyYUQi0XNud0j5f0woSN4x7xB7apyhajOHTwuPRmMBrVVOP WLF5OaNpq5tXM3rkr2l6o3ZwLMMmT3tDQgD93ZuBYVu3zzqG251x+qdT8wHDAB3Zoz+p AXAWwQfHakvzGmV/5sTcBSeZ0x+n4n5JOHjmBJvtMxFLWrbGx/dgA35OjKizHW+qjQDx cFHQ== 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 h2si1854472pgc.677.2018.04.08.01.00.03; Sun, 08 Apr 2018 01:01:13 -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 S1751917AbeDHHor (ORCPT + 99 others); Sun, 8 Apr 2018 03:44:47 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:47515 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbeDHHop (ORCPT ); Sun, 8 Apr 2018 03:44:45 -0400 Received: from linux-l9pv.suse (124-11-22-254.static.tfn.net.tw [124.11.22.254]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Sun, 08 Apr 2018 09:44:37 +0200 Date: Sun, 8 Apr 2018 15:44:09 +0800 From: joeyli To: Matthew Garrett Cc: alexei.starovoitov@gmail.com, luto@kernel.org, David Howells , Ard Biesheuvel , jmorris@namei.org, Alan Cox , Linus Torvalds , Greg Kroah-Hartman , Linux Kernel Mailing List , jforbes@redhat.com, linux-man@vger.kernel.org, LSM List , linux-api@vger.kernel.org, Kees Cook , linux-efi Subject: Re: [GIT PULL] Kernel lockdown for secure boot Message-ID: <20180408074409.GD7362@linux-l9pv.suse> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 04, 2018 at 04:31:46AM +0000, Matthew Garrett wrote: > On Tue, Apr 3, 2018 at 7:34 PM Alexei Starovoitov < > alexei.starovoitov@gmail.com> wrote: > > If the only thing that folks are paranoid about is reading > > arbitrary kernel memory with bpf_probe_read() helper > > then preferred patch would be to disable it during verification > > when in lockdown mode. > > No run-time overhead and android folks will be happy > > that lockdown doesn't break their work. > > They converted out-of-tree networking accounting > > module and corresponding user daemon to use bpf: > > https://www.linuxplumbersconf.org/2017/ocw/system/presentations/4791/original/eBPF%20cgroup%20filters%20for%20data%20usage%20accounting%20on%20Android.pdf > > An alternative would be to only disable kernel reads if the kernel contains > secrets that aren't supposed to be readable by root. If the keyring is > configured such that root can read everything, it seems like less of a > concern? Currently the KMK (kernel master key) can be a trusted key (TPM sealed) or a user key (plaintext). The EVM keeps a key (plaintext) in memory that it is decrypted from a KMK encrypted key. Those kernel reads functions should be disabled when the KMK be loaded to keyring. You idea is good that kernel can keep those reads functions enabled until KMK be loaded. Which means those functions are still available before user enables KMK and EVM. There have another idea is using a tree to register all sensitive data then blanking them when reading. Here is a very early developing version: https://github.com/joeyli/linux-sensitive_data/commits/sensitive-data-tree-v0.1-v4.15 But this approach causes runtime overhead and all sensitive data address must be found and registered (e.g. plaintext in encryption module) Thanks a lot! Joey Lee