Re: [PATCH] bpf: allow BPF_LOG_KERNEL from kernel space

From: Sid Nayyar

Date: Wed Jun 24 2026 - 09:59:16 EST


On Tue, Jun 23, 2026 at 9:50 PM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
> This feels a bit dirty. We already have BPF_LOG_KERNEL which is passed
> through log_level, so wouldn't it be better to just make sure that
> BPF_LOG_KERNEL is not rejected when program is loaded from inside the
> kernel, instead of passing along extra bool everywhere?

I was concerned about userspace loaders exploiting this to spam the
kernel logs, hence decided to implement this way. I guess I can
enforce a privilege check at the syscall boundary points to prevent
that.

I will follow up with that implementation.

Regards,
Siddharth Nayyar