Live data from Hacker News

Ask HN: Firefox vs. Chrome security

news.ycombinator.com

11–20 of 73 posts

Re: Ask HN: Firefox vs. Chrome security

#11
post #8
post #4

Earlier quoted context omitted.

Apparently about a third of browser security vulnerabilities can be traced to memory safety issues. So, yes.

But how many of them come from the rendering engine?

A quick look at the recent CVEs for Firefox seems like most of them come from there.

Re: Ask HN: Firefox vs. Chrome security

#12
post #9
post #8

Earlier quoted context omitted.

But how many of them come from the rendering engine?

They're slowing replacing more and more code with Rust. So eventually Rust will have a much bigger impact.

Rust helps in to avoid segFaults which helps in avoid buffer overflows and stack overflows. most of security attacks are due to these and can prevent them better. there is no way a developer can write a code in Rust that causes segfaults ( atleast language promises that ).

recent blog post https://blog.rust-lang.org/2017/11/14/Fearless-Concurrency-I...

Re: Ask HN: Firefox vs. Chrome security

#13
post #7

My understanding is, that Firefox Quantum is not faster due to any additional rust parts, but because the team focused on performance optimization across the entire codebase. The only big rust component was introduced a couple of releases ago: Stylo. Once Webrender is in Firefox, a serious chunk of Firefox will be written in Rust.

This is incorrect, Stylo is new in 57 and part of the speed boost of Quantum.

Re: Ask HN: Firefox vs. Chrome security

#14
post #7

My understanding is, that Firefox Quantum is not faster due to any additional rust parts, but because the team focused on performance optimization across the entire codebase. The only big rust component was introduced a couple of releases ago: Stylo. Once Webrender is in Firefox, a serious chunk of Firefox will be written in Rust.

My understanding was the Stylo is released to the production channel today, and it is a major part of the performance boost.

"Quantum" as a term covers a large number of areas, this blog post covers it well:

https://hacks.mozilla.org/2017/11/entering-the-quantum-era-h...

Re: Ask HN: Firefox vs. Chrome security

#15
post #9

Earlier quoted context omitted.

They're slowing replacing more and more code with Rust. So eventually Rust will have a much bigger impact.

Rust helps in to avoid segFaults which helps in avoid buffer overflows and stack overflows. most of security attacks are due to these and can prevent them better. there is no way a developer can write a code in Rust that causes segfaults ( atleast language promises that ). recent blog post https://blog.rust-lang.org/2017/11/14/Fearless-Concurrency-I...

> there is no way a developer can write a code in Rust that causes segfaults ( atleast language promises that ).

Well, as long as you avoid unsafe blocks (which turn off a few safety features in a specific scope so you can do complex or performance critical things in that scope) you're supposed to be safe, but to my knowledge it's not formally proven. In practice it seems to be working quite well though.

Re: Ask HN: Firefox vs. Chrome security

#16
post #8
post #4

Earlier quoted context omitted.

Apparently about a third of browser security vulnerabilities can be traced to memory safety issues. So, yes.

But how many of them come from the rendering engine?

Written in C/C++ or any memory-unsafe language means the above.

Re: Ask HN: Firefox vs. Chrome security

#17
post #7

My understanding is, that Firefox Quantum is not faster due to any additional rust parts, but because the team focused on performance optimization across the entire codebase. The only big rust component was introduced a couple of releases ago: Stylo. Once Webrender is in Firefox, a serious chunk of Firefox will be written in Rust.

Stylo is a big perf jump, but so are many of other changes. It isn't solely replacing things with Rust that has made it fast.

Re: Ask HN: Firefox vs. Chrome security

#18
post #7

My understanding is, that Firefox Quantum is not faster due to any additional rust parts, but because the team focused on performance optimization across the entire codebase. The only big rust component was introduced a couple of releases ago: Stylo. Once Webrender is in Firefox, a serious chunk of Firefox will be written in Rust.

Stylo is about 10x faster than the old style system on a four core machine, and about 4x faster than Chrome's style system. This feature alone is worth 30% of initial page load time on amazon and youtube.

So yes, Quantum is faster as a direct result both of Rust code, and of Rust's memory-safety-makes-parallelism-practical features. That is not the only source of performance improvement in Quantum though.

Also, Quantum isn't yet getting the full benefits possible from this code for a few reasons. Firefox 57 uses Stylo for content, but not yet for chrome, which will be coming in a later release. In Servo, CSS is parsed off the main thread, but in Quantum it is not yet (will be done in a future release). Servo pipelines style resolution and frame construction (basically after the top down pass to deal with the style cascade, we go back up the tree bottom up constructing the layout data structures), and Quantum does not yet do this. Lastly, cross-language inlining is missing which would allow inlining FFI calls. Servo doesn't have this issue since all the driver and layout code is also in Rust.

Re: Ask HN: Firefox vs. Chrome security

#19
post #9

Earlier quoted context omitted.

They're slowing replacing more and more code with Rust. So eventually Rust will have a much bigger impact.

Rust helps in to avoid segFaults which helps in avoid buffer overflows and stack overflows. most of security attacks are due to these and can prevent them better. there is no way a developer can write a code in Rust that causes segfaults ( atleast language promises that ). recent blog post https://blog.rust-lang.org/2017/11/14/Fearless-Concurrency-I...

> there is no way a developer can write a code in Rust that causes segfaults ( atleast language promises that ).

Well, you can very easily: write bad code in unsafe blocks.

That said, your badness is contained within unsafe blocks, so hopefully you have much less code to closely review.

Re: Ask HN: Firefox vs. Chrome security

#20
From Peter Bright at Ars: "And security remains a pressing concern, prompting the use of new techniques to protect against exploitation. Some of the rebuilt portions are even using Mozilla's new Rust programming language, which is designed to offer improved security compared to C++.

While today's release represents a major step forward in the browser's performance and reliability, work on Quantum continues. One major weakness of Firefox, relative to Chrome and Edge, is its use of sandboxing and process isolation to limit the impact that security flaws can have. Next year Mozilla will be working to improve these areas. Early next year should also see the rollout of a new GPU-accelerated rendering engine."

Post reply on HN