Re: [PATCH bpf-next v1 1/3] x86/mm: Resolve BPF exception fixups for user address faults under SMAP
From: Borislav Petkov
Date: Sun Nov 22 2026 - 23:34:42 EST
On Mon, Nov 23, 2026 at 04:56:46AM +0100, Kumar Kartikeya Dwivedi wrote:
> I am happy to engage with any actual material concerns. So far I
> haven't seen any except you being constantly dismissive.
Sorry if I have given you that impression. I was actually gebuinely trying to
work with you by asking you to come up with a different solution. And I gave
you my main material concern: this hack to the #PF handler just to save some
performance is not good enough! No matter from where I look at it.
But then *you* became dismissive when you started giving me the spiel about
I should not question the BPF design and I should take this no questions
asked.
And such an approach definitely does not work.
So lemme try to elaborate and give you some more concerns of mine:
1. How reliable is is_bpf_text_address() and what happens if someone manages
to pull off a hack which bypasses it? In that case, SMAP is basically
disabled. And yes, "no one can hack this", "can't ROP-chain around it" and
whatever else is not a good answer. This silly function becomes the last
and only line of defense.
2. Is the rest of the arch code going to get "if is_bpf..." sprinkled around
it because of some other performance argument?
Because long time ago there was a pile of patches which did sprinkle "if
(xen)" and they didn't go anywhere. The point being, special-casing
something completely unrelated is not going to fly.
3. What do I tell the next userspace program type set which wanna do "if
is_Y_program" in the #PF handler? I take them too? Because I should not
question their design either and who do I think I am to question that?
HTH.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette