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

From: Sid Nayyar

Date: Mon Jun 29 2026 - 12:46:44 EST


On Thu, Jun 25, 2026 at 9:02 PM Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> I don't think it's a good idea.
> BPF_LOG_KERNEL prints to dmesg and it's there for cases
> where BTF is corrupted in vmlinux or in the module.
> The verifier log can be large. It's never suitable for dmesg.
>
> Let's step back and discuss the end goal.
> Not just this patch, but overall.
> You're sending a bunch of patches for various lskel things.
> Please explain the full picture.
>
> pw-bot: cr

I am trying to enable support for STRUCT_OPS maps in light skeletons.
The idea is to enable loading sched_ext eBPF programs using in-kernel
loaders, such as a kernel module. I am preparing to send a patch
series for the same.

The changes I have been sending fix bugs I found along the way, for
example poisoning unresolved weak kfuncs and fixing a typo in
struct_ops map FD generation.

This change, however, is not a bug fix but just a quality-of-life
improvement. Having the ability to enable BPF logs in dmesg for
in-kernel loaders has been helpful for debugging. Therefore I sent
this change upstream. I agree that enabling dmesg logs for loaders in
production is a bad idea, but in-kernel loaders can use this option
during development to ease debugging.

That said, I am happy to drop this change since it is merely a quality
of life improvement and doesn't deliver any crucial functionality.

Regards,
Siddharth Nayyar