|
|
Log in / Subscribe / Register

A crazy thought

A crazy thought

Posted Jan 20, 2026 14:13 UTC (Tue) by aszs (subscriber, #50252)
In reply to: A crazy thought by Cyberax
Parent article: Task-level io_uring restrictions

>> Yes, it does. WASM, just like eBPF, by construction can't access memory outside of its sandbox.

my first comment:

"WASM prevents code from accessing memory outside its sandbox but it doesn't provide memory safety within its sandbox. To provide safety guarantees similar to BPF you would need to make some pretty big changes to WASM. For example, see https://arxiv.org/abs/2208.13583"

We are literally going in circles. How would your in-kernel wasm jit handle the task_struct pointer returned by bpf_get_current_task_btf()? Or modifying xdp packets with apis like https://docs.ebpf.io/linux/helper-function/bpf_xdp_adjust... And do stuff like that safely without overhead?


to post comments

A crazy thought

Posted Jan 20, 2026 18:48 UTC (Tue) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

> We are literally going in circles. How would your in-kernel wasm jit handle the task_struct pointer returned by bpf_get_current_task_btf()?

Would you read the WASM spec, please? The task_struct will be modeled as a WASM structure type: https://webassembly.github.io/spec/core/syntax/types.html... It's accessible via _references_ only ( https://webassembly.github.io/spec/core/syntax/types.html... ):

> Reference types are opaque, meaning that neither their size nor their bit pattern can be observed. Values of reference type can be stored in tables but not in memories.

It will NOT be accessible using pointer operations from any memory blocks. That's how browsers expose complex objects into the WASM world.

Just like in eBPF (does that phrase sound familiar by now?).

> And do stuff like that safely without overhead?

Yes. Just like in eBPF.

Again, this is not something theoretical or exotic. That's how browsers work RIGHT NOW.

A crazy thought

Posted Jan 21, 2026 17:35 UTC (Wed) by notriddle (subscriber, #130608) [Link] (1 responses)

It’s probably worth pointing out that the features you’re talking about are less than a year old. https://webassembly.org/news/2025-09-17-wasm-3.0/

Not necessarily a problem, but it does mean that the idea of wasm being “battle-tested” is wrong. The features you think they should rely on are new.

A crazy thought

Posted Jan 21, 2026 18:41 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

The typed references are new, but even the first version of WASM had something similar: https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#exte...

External types were represented as tables and functions with similar limitations, they were treated as opaque objects without any ways to get to their exact binary representation (never mind modify them).


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