Thread (15 messages) 15 messages, 3 authors, 2025-06-15

Re: [PATCH bpf 2/7] bpf/x86: prevent trampoline attachment when args location on stack is uncertain

From: Alexis Lothoré <hidden>
Date: 2025-06-13 08:59:37
Also in: bpf, linux-kselftest, linux-riscv, linux-s390, lkml, netdev

On Fri Jun 13, 2025 at 10:32 AM CEST, Peter Zijlstra wrote:
On Fri, Jun 13, 2025 at 10:26:37AM +0200, Alexis Lothoré wrote:
quoted
Hi Peter,

On Fri Jun 13, 2025 at 10:11 AM CEST, Peter Zijlstra wrote:
quoted
On Fri, Jun 13, 2025 at 09:37:11AM +0200, Alexis Lothoré (eBPF Foundation) wrote:
[...]
quoted
Maybe my commit wording is not precise enough, but indeed, there's not
doubt about whether the struct value is passed on the stack or through a
register/a pair of registers. The doubt is rather about the struct location
when it is passed _by value_ and _on the stack_: the ABI indeed clearly
states that "Structures and unions assume the alignment of their most
strictly aligned component" (p.13), but this rule is "silently broken" when
a struct has an __attribute__((packed)) or and __attribute__((aligned(X))),
and AFAICT this case can not be detected at runtime with current BTF info.
Ah, okay. So it is a failure of BTF. That was indeed not clear.
If I need to respin, I'll rewrite the commit message to include the details
above.

Alexis




-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help