Re: [PATCH 18/27] bpf: Restrict kernel image access functions when the kernel is locked down

From
David Howells <dhowells@redhat.com>
Date
2017-10-19 22:48:41
Also in
linux-efi, linux-security-module, lkml
Reply to
Alexei Starovoitov, 2017-10-19
Alexei Starovoitov [off-list ref] wrote:
quoted
@@ -65,6 +65,11 @@ BPF_CALL_3(bpf_probe_read, void *, dst, u32, size, const void *, unsafe_ptr)
 {
 	int ret;
 
+	if (kernel_is_locked_down("BPF")) {
+		memset(dst, 0, size);
+		return -EPERM;
+	}
That doesn't help the lockdown purpose.
If you don't trust the root the only way to prevent bpf read
memory is to disable the whole thing.
Have a single check in sys_bpf() to disallow everything if kernel_is_locked_down()
and don't add overhead to critical path like bpf_probe_read().
TBH, I've no idea how bpf does anything, so I can't say whether this is
better, overkill or insufficient.

David
Thread (13 messages) 13 messages, 3 authors, last reply 2017-11-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help