[go: up one dir, main page]

|
|
Log in / Subscribe / Register

WASM?

WASM?

Posted Jun 8, 2024 2:25 UTC (Sat) by Cyberax (✭ supporter ✭, #52523)
In reply to: WASM? by roc
Parent article: Modernizing BPF for the next 10 years

WASM and BPF instructions and registers are equally typed. And access to memory is equally untyped: https://www.kernel.org/doc/html/latest/bpf/standardizatio...

At this point there's no conceptual between WASM and eBPF. The eBPF runtime tries to be more resilient to timing attacks (via constant blinding), but that's a property of runtime. It can be added to WASM runtimes.


to post comments

WASM?

Posted Jun 8, 2024 11:15 UTC (Sat) by aszs (subscriber, #50252) [Link]

The BPF verifier validates pointers, (within its sandbox) WASM does not.
See, for example, https://dl.acm.org/doi/10.1145/3571208:
"memory-unsafe C code remains unsafe when compiled to Wasm—and attackers can exploit buffer overflows and use-after-frees in Wasm almost as easily as they can on native platforms."
(And I just noticed one of that paper's authors is also a contributor to the Wasm spec)

WASM?

Posted Jun 10, 2024 7:31 UTC (Mon) by roc (subscriber, #30627) [Link] (1 responses)

The eBPF verifier does type propagation and checking and prevents pointer arithmetic. https://docs.kernel.org/6.1/bpf/verifier.html#register-va...
It's not well documented and all very ad-hoc, but this is not the usual WASM array-of-bytes model.

I think the closest WASM equivalent of this is reference types, which are pretty new. I don't see instructions for doing field load/stores via references yet.

WASM?

Posted Jun 10, 2024 17:11 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link]

I doubt that this tracking adds any real value. For practical reasons, it's likely that just adding range-checking accessors should be enough for practical reasons.

I'm also going to bet, that eBPF will grow pointer arithmetic that can re-interpret types in the future.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds