Live data from Hacker News

Cervus: A WebAssembly subsystem for Linux

github.com

51–60 of 61 posts

Re: Cervus: A WebAssembly subsystem for Linux

#51
post #29

Earlier quoted context omitted.

The cost of context switching is near zero. No need for expensive TLB flushes, for instance. No need for paged memory whose overhead sometimes accounts for up to 50% of program runtimes. Better isolation properties, since you can sandbox individual objects instead of whole processes.

> expensive TLB flushes Note that modern CPUs store a tag of the current "address space ID" next to the TLB line, thus the cost of the flushing is heavily reduced. > No need for paged memory Unless you mean swapping, this doesn't apply as x86_64 long mode requires paging to be enabled.

> Note that modern CPUs store a tag of the current "address space ID" next to the TLB line, thus the cost of the flushing is heavily reduced.

Except you flush the TLBs as part of the meltdown mitigation.

Re: Cervus: A WebAssembly subsystem for Linux

#53

From the readme: > I'm busy with my College Entrance Examination until ~June 10, 2018 This dude is in high school?! When I was your age I thought I was smart for writing a youtube scraper in PHP... Awesome work, really creative solution. Good luck to you.

Yay progress!

Really though, they seem quite bright. But I like seeing younger people excelling like this because it means the tutorials, wikis, blogs, etc. that their "forefathers" wrote are doing "good" in the world.

Re: Cervus: A WebAssembly subsystem for Linux

#55

From the readme: > I'm busy with my College Entrance Examination until ~June 10, 2018 This dude is in high school?! When I was your age I thought I was smart for writing a youtube scraper in PHP... Awesome work, really creative solution. Good luck to you.

I believe the other person working on a wasm kernel in Rust is also in high school. They take two different approaches, I can’t wait to see how all of this turns out!

A real High School drama, not that fake stuff on the telly ;).

Re: Cervus: A WebAssembly subsystem for Linux

#56
post #5

Having web assembly be a native subsystem... That's brilliant. Why has this not been attempted for Java or anything else for that matter? I guess you could count Microsoft's .NET implementation. In any case, you could extend this beyond just user mode. Currently the domain of safe ring0 execution is eBPF as far as I know, but this would be way more approachable and other operating systems could implement it. I've got…

You can write kernel modules for netbsd in lua.

http://mail-index.netbsd.org/source-changes/2013/10/16/msg04...

Re: Cervus: A WebAssembly subsystem for Linux

#57
post #38

Earlier quoted context omitted.

I thought the point was that it became trusted code as it was transpiled into WA, due to all the checks and what not that could be applied. So as you said a bug in the system would be a kernel exploit. How would this be any different than a exploit in today's kernels? The result would be the same, a bug fix to a kernel, or a fix to the transpiler. My point is while user running programs in ring 3 protect from bugs an…

> So as you said a bug in the system would be a kernel exploit. How would this be any different than a exploit in today's kernels? Because now you moved a massive amount of software (namely, the engine implementation, which includes a dynamic compiler, memory management, runtime system, etc--850,000 lines of code for V8) into the kernel, and you just eschewed the simplest of hardware mechanisms (which have been very…

The parts of V8 handling WASM don't include the JS parser / compiler / optimizer.

Re: Cervus: A WebAssembly subsystem for Linux

#58

Can someone explain what this is actually useful for, if you're not a kernel developer? Would people in userland care about anything like this?

The most important applications are likely data processing -- batch and real-time -- and very high performance web applications. These are environments where:

* Different applications are typically isolated from one another by being on different machines.

* Application and hardware failures are handled with the "let if fail" philosophy, where individual machines are treated as disposable.

* Components are written in-house and typically are quite trusted (even if they don't deserve to be).

People in "userspace" do, on occasion, care a lot about the overhead of syscalls. Userspace networking -- https://lwn.net/Articles/713918/ -- is a different approach, where a functionality is moved wholly out of the kernel.

Re: Cervus: A WebAssembly subsystem for Linux

#59
post #38

Earlier quoted context omitted.

I thought the point was that it became trusted code as it was transpiled into WA, due to all the checks and what not that could be applied. So as you said a bug in the system would be a kernel exploit. How would this be any different than a exploit in today's kernels? The result would be the same, a bug fix to a kernel, or a fix to the transpiler. My point is while user running programs in ring 3 protect from bugs an…

> So as you said a bug in the system would be a kernel exploit. How would this be any different than a exploit in today's kernels? Because now you moved a massive amount of software (namely, the engine implementation, which includes a dynamic compiler, memory management, runtime system, etc--850,000 lines of code for V8) into the kernel, and you just eschewed the simplest of hardware mechanisms (which have been very…

I don't think there is a massive amount of software required. The linked module above is just over 2k lines and compiles to around ~250kb in size. Clearly not all of those things you mentioned. All you need is the a implementation of the wasm state machine. Keep in mind this is WASM not javascript, and not asm.js. Its a entirely new platform independent specification for a byte code.

I would wager to say a implementation in rust is far safer than all of the code that goes into today's linux kernel to run non wasm binaries.

You linked me to TCB, the entire point of the the OPs link to nebullit and cervus is that with this new strategy a entire new security module and way to think about and run un-trusted code has come about. So linking to old ideals and papers explaining how computer security works today only can be used as how things are done now. When the talk about running in ring 0 comes up they are challenging those very ideas. And doing a good job of showing how it can safely be done.

Baring bugs -- yes bugs can happen -- in both the old way and in the new ideas being tossed around with wasm they both are able to provide a level of security. One relies on hardware that can't be easily changed (microcode, new cpu...) , is hard to audit -- and in some cases impossible to audit.

The new notion of compile time checking with wasm allows for a clean approach to ensuring bad programs don't crash the system. Because it does not rely on hardware, but code it can be updated and audited.

I am not arguing that somebodies show HN fun toy is going to be better than 50 years of progress. But I am arguing that a few good years of investment can jump us past those 50 years into a new age of computing, not bogged down by legacy cpu architectures.

Re: Cervus: A WebAssembly subsystem for Linux

#60
post #48

Earlier quoted context omitted.

If you want to feel better, I didn't know what a variable was until I was 28. I feel pretty lame compared to virtually everyone here on HN haha.

Well, then, here, take my hug (>^_^)>

<(^_^<)
Post reply on HN