3 ms·
>But you can forbid it to access other memory areas for security Not in C/++ in any standard definition of "thread".
by silon 15y ago
>But you can forbid it to access other memory areas for security
Not in C/++ in any standard definition of "thread".
- zobzu 15y agoWhat 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.
- tptacek 15y agoEvery browser does that. Virtually all the problems that matter are internal to the browser.
- zobzu 15y agothats 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.
- tptacek 15y agoI 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?
- icebraining 15y agoDepends 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.
- tptacek 15y agoSure! 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.
- scott_s 15y agoSure you can. Use the mprotect() system call: http://pubs.opengroup.org/onlinepubs/7908799/xsh/mprotect.html http://pubs.opengroup.org/onlinepubs/7908799/xsh/mprotect.ht...
- beagle3 15y agomprotect() doesn't let different threads have different read/write permissions to a page. You need different processes to achieve that.