bpf: Restrict kernel image access functions when the kernel is locked down
authorDavid Howells <dhowells@redhat.com>
Mon, 18 Feb 2019 12:45:02 +0000 (12:45 +0000)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 26 Sep 2019 12:19:06 +0000 (13:19 +0100)
commit81e3b7c95bfb8e51f8c7ccd02a7f81f014c6497e
treee66737be9e411288303cf54dc27f437504c6f0d5
parent97d13a35925f334456524ff23118d7c06bcbe412
bpf: Restrict kernel image access functions when the kernel is locked down

There are some bpf functions can be used to read kernel memory:
bpf_probe_read, bpf_probe_write_user and bpf_trace_printk.  These allow
private keys in kernel memory (e.g. the hibernation image signing key) to
be read by an eBPF program and kernel memory to be altered without
restriction.

Completely prohibit the use of BPF when the kernel is locked down.

Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: netdev@vger.kernel.org
cc: Chun-Yi Lee <jlee@suse.com>
cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>

Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name 0025-bpf-Restrict-kernel-image-access-functions-when-the-.patch
kernel/bpf/syscall.c