Hacker News new | past | comments | ask | show | jobs | submit login

Firefox compartment memory as well. Using a separate process it the easy way, using thread is the hard way. Each has pro and cons I guess. Even Firefox is getting a multiprocess model for testing.

But for example you can't completely isolate a thread if it crashes. But you can forbid it to access other memory areas for security, that's what Firefox does.

Since Firefox 4 each tab has it's own separate garbage collector.




>But you can forbid it to access other memory areas for security

Not in C/++ in any standard definition of "thread".


What you mean is not in a mandatory fashion and at the C code level and that's true. But what I meant is that you can do it for the objects you manage, such as JS code and the rest of the webpage. It doesn't prevent an issue in the Firefox interpreter itself.


Every browser does that. Virtually all the problems that matter are internal to the browser.


thats not true. FF 3.6 and before that did not compartment it per tab.

Likewise for IE, but they're per process like Chrome now.

Not sure about other webkit browsers and Opera, it's likely other wekbit browsers (except safari) do not do that.


I can't follow what you're trying to say here. I'm probably just misunderstanding you. Someone suggested that Firefox had memory segmentation, and just did it with threads. That's obviously not accurate. Then you said, "they have it, just with javascript objects". What mainstream browser allows javascript in a tab to access objects in any other page, let alone another tab?


Depends on what JS it is. Obviously websites can't, but a huge part of Firefox is coded in JS, which runs with high privileges. It's perfectly possible that tab specific trusted JS code (including possibly extensions code) wasn't compartmentalized and now is.


Sure! Just keep in mind that a lot of that "trusted JS" is actually just a thin wrapper around C/C++ code, and the C/C++ code tends to be where the problems arise.


Sure you can. Use the mprotect() system call: http://pubs.opengroup.org/onlinepubs/7908799/xsh/mprotect.ht...


mprotect() doesn't let different threads have different read/write permissions to a page. You need different processes to achieve that.


No, threads on x86 share page hierarchies and cannot be configured not to access memory accessible by any one thread.




Registration is open for Startup School 2019. Classes start July 22nd.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: