From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751672AbeDCPmE (ORCPT ); Tue, 3 Apr 2018 11:42:04 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:34482 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbeDCPmB (ORCPT ); Tue, 3 Apr 2018 11:42:01 -0400 X-Google-Smtp-Source: AIpwx49ZVIGNTkhstMBYryWU9A2W0CZUkvqnZpeFYfbrbGc5wS1OPxthD8e3Wn7DiPp+b0XJRvAZyg== Date: Tue, 3 Apr 2018 08:41:58 -0700 From: Alexei Starovoitov To: Andy Lutomirski Cc: David Howells , Ard Biesheuvel , James Morris , One Thousand Gnomes , Linus Torvalds , Matthew Garrett , Greg KH , LKML , Justin Forbes , linux-man , joeyli , LSM List , Linux API , Kees Cook , linux-efi Subject: Re: [GIT PULL] Kernel lockdown for secure boot Message-ID: <20180403154156.f37wrzjhuvijzi2i@ast-mbp.dhcp.thefacebook.com> References: <4136.1522452584@warthog.procyon.org.uk> <186aeb7e-1225-4bb8-3ff5-863a1cde86de@kernel.org> <30459.1522739219@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 03, 2018 at 08:11:07AM -0700, Andy Lutomirski wrote: > > > >> "bpf: Restrict kernel image access functions when the kernel is locked down": > >> This patch just sucks in general. > > > > Yes - but that's what Alexei Starovoitov specified. bpf kind of sucks since > > it gives you unrestricted access to the kernel. > > bpf, in certain contexts, gives you unrestricted access to *reading* > kernel memory. bpf should, under no circumstances, let you write to > the kernel unless you're using fault injection or similar. > > I'm surprised that Alexei acked this patch. If something like XDP or > bpfilter starts becoming widely used, this patch will require a lot of > reworking to avoid breaking standard distros. my understanding was that this lockdown set attemps to disallow _reads_ of kernel memory from anything, so first version of patch was adding run-time checks for bpf_probe_read() which is no-go and without this helper the bpf for tracing is losing a lot of its power, so the easiest is to disable it all. I think lockdown suppose to disable xdp, bpfilter, nflog, raw sockets + pcap too otherwise even cap_net_admin can see traffic coming into host. Similarly kprobe, perf_event, ftrace should be off as well?