News for hackers. Stuff that matters.
Re:Scalability by zobzu on Wednesday August 03, 2011 @06:44AM (#2840566)
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.

Re:Scalability by silon on Wednesday August 03, 2011 @06:57AM (#2840590)
>But you can forbid it to access other memory areas for security

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

Re:Scalability by zobzu on Wednesday August 03, 2011 @07:12AM (#2840637)
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.
Re:Scalability by tptacek on Wednesday August 03, 2011 @08:53AM (#2840926)
Every browser does that. Virtually all the problems that matter are internal to the browser.
Re:Scalability by zobzu on Wednesday August 03, 2011 @09:40AM (#2841078)
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.

Re:Scalability by tptacek on Wednesday August 03, 2011 @09:44AM (#2841095)
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?
Re:Scalability by icebraining on Wednesday August 03, 2011 @10:10AM (#2841205)
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.
Re:Scalability by tptacek on Wednesday August 03, 2011 @04:15PM (#2842850)
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.
Re:Scalability by scott_s on Wednesday August 03, 2011 @07:47AM (#2840720)
Sure you can. Use the mprotect() system call: http://pubs.opengroup.org/onlinepubs/7908799/xsh/mprotect.ht...
Re:Scalability by beagle3 on Wednesday August 03, 2011 @08:31AM (#2840846)
mprotect() doesn't let different threads have different read/write permissions to a page. You need different processes to achieve that.
Re:Scalability by tptacek on Wednesday August 03, 2011 @08:55AM (#2840929)
No, threads on x86 share page hierarchies and cannot be configured not to access memory accessible by any one thread.