bpf: Restrict kernel image access functions when the kernel is locked down
authorDavid Howells <dhowells@redhat.com>
Wed, 24 May 2017 13:56:05 +0000 (14:56 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 19 Apr 2018 10:13:03 +0000 (11:13 +0100)
commit08df190431b8b07f86d5018e825e8cbe82ab8336
treed15e8309a5c4a65b1527d1735814392cf4ce3980
parent8b8a9fc2cd20604873a701cddb511ef73bcb5798
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 0027-bpf-Restrict-kernel-image-access-functions-when-the-.patch
kernel/bpf/syscall.c