Ubuntu is switching its default sudo
implementation to a memory-safe version written in Rust. This change, starting with Ubuntu 23.10 "Mantic Minotaur", significantly improves security by mitigating vulnerabilities related to memory corruption, such as buffer overflows and use-after-free bugs, which are common targets for exploits. This Rust-based sudo
is developed and maintained by the OpenSSF's Secure Software Supply Chain project, and represents a major step towards a more secure foundation for the widely-used system administration tool.
Rebuilding Ubuntu packages from source with sccache, a compiler cache, can drastically reduce compile times, sometimes up to 90%. The author demonstrates this by building the Firefox package, achieving a 7x speedup compared to a clean build and a 2.5x speedup over using the system's build cache. This significant performance improvement is attributed to sccache's ability to effectively cache and reuse compilation results, both locally and remotely via cloud storage. This approach can be particularly beneficial for continuous integration and development workflows where frequent rebuilds are necessary.
Hacker News users discuss various aspects of the proposed method for speeding up Ubuntu package builds. Some express skepticism, questioning the 90% claim and pointing out potential downsides like increased rebuild times after initial installation and the burden on build servers. Others suggest the solution isn't practical for diverse hardware environments and might break dependency chains. Some highlight the existing efforts within the Ubuntu community to optimize build times and suggest collaboration. A few users appreciate the idea, acknowledging the potential benefits while also recognizing the complexities and trade-offs involved in implementing such a system. The discussion also touches on the importance of reproducible builds and the challenges of maintaining package integrity.
Summary of Comments ( 69 )
https://news.ycombinator.com/item?id=43903853
Hacker News commenters generally expressed approval for Ubuntu's move to a memory-safe
sudo
, viewing it as a positive step towards improved security. Some questioned the significance of the change, pointing out thatsudo
itself isn't a frequent source of vulnerabilities and suggesting that efforts might be better directed elsewhere. A few expressed concerns about potential performance impacts, while others highlighted the importance of addressing memory safety issues in widely used system utilities likesudo
to mitigate even rare but potentially impactful vulnerabilities. The discussion also touched upon the broader trend of adopting Rust for system programming and the trade-offs between memory safety and performance. Several commenters shared anecdotes about past vulnerabilities related tosudo
and other core utilities, reinforcing the argument for enhanced security measures.The Hacker News post "Memory-safe sudo to become the default in Ubuntu" generated several comments discussing the implications of switching to a memory-safe version of
sudo
.Several commenters expressed strong approval for the move, emphasizing the importance of memory safety in a critical utility like
sudo
. They highlighted howsudo
's privileged position makes it a prime target for exploitation, and how memory safety mitigations can significantly reduce the risk of successful attacks. One commenter specifically mentioned how this change aligns with a broader industry trend towards prioritizing memory safety.Some discussion revolved around the choice of Rust as the language for the rewritten
sudo
. While generally praised for its memory safety features, a few commenters raised concerns about the potential performance overhead and the learning curve for developers accustomed to C. One commenter pointed out that the performance impact is likely negligible for a tool likesudo
, which isn't typically performance-critical. Another countered that while Rust's performance is often comparable to C, achieving optimal performance in Rust can require more effort.A few comments delved into the technical details of the rewrite, including the challenges of integrating Rust code with existing C codebases. One commenter mentioned the use of bindgen to create safe bindings, acknowledging the complexities involved in such integrations.
Several commenters expressed hope that other distributions would follow Ubuntu's lead in adopting a memory-safe
sudo
. The discussion also touched upon the wider adoption of memory-safe languages in system programming, with some suggesting that this move by Ubuntu could signal a significant shift in the industry.A couple of comments inquired about the timeline for the transition and the testing procedures in place to ensure a smooth rollout. There was also a brief discussion about the potential impact on existing scripts and configurations, with one commenter suggesting that the changes are unlikely to cause significant disruption.
Overall, the comments reflect a generally positive reception to the news, with many commenters acknowledging the importance of memory safety in system utilities and praising Ubuntu for taking the lead in this area. While some concerns were raised regarding performance and the learning curve associated with Rust, the overall sentiment leaned towards the long-term benefits of increased security.