Received: by 10.213.65.68 with SMTP id h4csp2651747imn; Mon, 9 Apr 2018 07:01:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/maRkpLlt0PgwmGVpsGuLjMS0y8vrFRWNEIKGGdv8XM0zzZDzDo3SQ8/7hwc7tTz0VP0Q0 X-Received: by 10.98.61.206 with SMTP id x75mr29112022pfj.233.1523282468406; Mon, 09 Apr 2018 07:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523282468; cv=none; d=google.com; s=arc-20160816; b=NmVWBp2EZpEs6HmnNlqFc99OwZiYN4XJGU6rLvyeDZBoja62jA+Rref2BlZwzCtREU ZXWm9s/WxYMbK5h9IvMY+cRppQcruJGZgEDZIcTdxCH3G4durjUllGp5QmjfaVIMxdWb q+dbd1vqgXjDxw5EkG8zGMMHcjOv+KR8389EufIdSvOvaZU2RUteFUq5Hcbt8ETgqYgq toyyfVxjPAsyxyAbT39vr6EIqCG/teSo9fzEi58lwqmZccOonJiL2NEO0enFqfCGqGcX KkoVLNC+t5DMq76kfbAZnfHqn1lYuVNGbtC4KDhXsNCngN3uepVh248B89bVKgmQS6d0 1mNg== 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=q65GfyEsZ4N9z18+Sk8FVq0ZmRzi7EaQ3M1t5pklS1k=; b=08Q/XxofjHROca7kxMTIERcwPFWoyLDLznPtjXzs6shCYXNfIjux3mj7QmtpQD2XLf ppvCfUKNZFhYnVgimxfnw7LsLnPlsp+pWn1s36RsTOjX/5l1PbQkEXfgJ8C0exiUenfA 63i3sWyogmpyRqd/5WhqkfxeHZJBqAcvDUvB8VPgtzNDjrNatrWhNiHGXalJOG+3LkYu SUS7aikHBb8qY+jY3as2MQN7orACmghwH61wvPsBig0SW/8Vj04rw1AKspvFNyq2ReSl zbUqpcjFySW5bCUaTzSHEZ5qHXjW+/Rg/WX/TkfkkMOq3GtPgnEjbWsOuyrwFqQN9idK Pcqg== 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 q7si264368pgf.461.2018.04.09.07.00.30; Mon, 09 Apr 2018 07:01:08 -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 S1752721AbeDIN4N (ORCPT + 99 others); Mon, 9 Apr 2018 09:56:13 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:60583 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916AbeDIN4K (ORCPT ); Mon, 9 Apr 2018 09:56:10 -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); Mon, 09 Apr 2018 15:56:00 +0200 Date: Mon, 9 Apr 2018 21:55:47 +0800 From: joeyli To: Alexei Starovoitov Cc: Andy Lutomirski , David Howells , Ard Biesheuvel , James Morris , One Thousand Gnomes , Linus Torvalds , Matthew Garrett , Greg KH , LKML , Justin Forbes , linux-man , LSM List , Linux API , Kees Cook , linux-efi , Daniel Borkmann Subject: Re: [GIT PULL] Kernel lockdown for secure boot Message-ID: <20180409135547.GD17840@linux-l9pv.suse> References: <20180408080742.GE7362@linux-l9pv.suse> <20180409034008.dyte7k5kgkbjh5is@ast-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180409034008.dyte7k5kgkbjh5is@ast-mbp.dhcp.thefacebook.com> 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 Sun, Apr 08, 2018 at 08:40:10PM -0700, Alexei Starovoitov wrote: > On Sun, Apr 08, 2018 at 04:07:42PM +0800, joeyli 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 > > > > Sorry for I didn't fully understand your idea... > > Do you mean that using bpf verifier to filter out bpf program that > > uses bpf_probe_read()? > > Take a look bpf_get_trace_printk_proto(). > Similarly we can add bpf_get_probe_read_proto() that > will return NULL if lockdown is on. > Then programs with bpf_probe_read() will be rejected by the verifier. > OK, I saw check_helper_call(). Thank you for point it out. it's good idea! Joey Lee