Home » today » Sport » Google’s memory safety plan still involves unsafe C/C++ • The Register

Google’s memory safety plan still involves unsafe C/C++ • The Register

Google‘s Dual Approach to Memory Safety: Bridging Old and New Code

In a significant stride towards enhancing memory safety in programming, Google has unveiled a comprehensive strategy that combines the adoption of memory-safe languages alongside efforts to secure legacy languages deemed unsafe. This innovative approach recognizes the enduring presence of C and C++ codebases while enthusiastically championing modern languages like Rust, which inherently offer stronger memory safety guarantees.

A New Chapter in Memory Safety

For years, Google has actively highlighted the security advantages associated with crafting code in memory-safe languages (MSLs). These languages, including Rust, Java, Kotlin, Go, and Python, reduce the risk of vulnerabilities that arise from improper memory management—a prevalent issue in older programming languages like C and C++. In a recent blog post, Googlers Alex Rebert, Chandler Carruth, Jen Engel, and Andy Qin expressed, “Our long-term objective is to progressively and consistently integrate memory-safe languages into Google’s codebases while phasing out memory-unsafe code in new development.” However, the reality remains that substantial C and C++ codebases will persist, requiring a solid plan to mitigate existing vulnerabilities.

Understanding Memory Safety Vulnerabilities

Memory safety bugs have plagued programming for over five decades, often stemming from undefined behavior caused by improper memory access. Such issues occur when a program in an unsafe language attempts to read or write memory outside its allocated region, leading to out-of-bounds errors. Compounding the problem is the responsibility on programmers to manage memory within C and C++, making these languages more susceptible to vulnerabilities; data from Google indicates that around 75% of Common Vulnerabilities and Exposures (CVEs) exploited in zero-day attacks relate to memory safety.

International Response and Google’s Initiatives

The growing awareness of memory safety flaws has prompted a global initiative endorsed by government cybersecurity agencies to encourage the switch to MSLs whenever practical, alongside efforts to upgrade existing unsafe code. Google has embraced this shift, investing resources to bolster the C++ standard library through extensive bounds-checking across its workloads. Noteworthy advancements, such as Chrome’s MiraclePtr mechanism—reportedly reducing use-after-free memory bugs by 57%—showcase Google’s commitment to improved memory management and security.

In parallel, Google is advancing isolation techniques like sandboxing and privilege reduction. Projects such as the beta release of the V8 heap sandbox and the recently launched Project Naptime, a large language model-based vulnerability hunting tool, reflect the company’s dedication to safeguarding its vast codebase.

Collaborative Efforts in the Industry

Google’s initiative aligns with broader efforts across the tech landscape to reinforce the security of C and C++. The Open Source Security Foundation has produced guides on hardening C and C++ code, while the C++ Alliance has introduced a Safe C++ Extensions proposal aimed at making these traditional languages safer. Significant changes are on the horizon as C23—the latest draft of the C programming language—incorporates features like N3020, which enhances read-only memory safety.

Even Bjarne Stroustrup, the creator of C++, has contributed to this movement by proposing "Safety Profiles," a structured set of rules designed to ensure certain safety guarantees within the language.

The Future of Programming Languages

As Google forges ahead with its dual approach, the tech industry stands on the precipice of change. The integration of memory-safe languages may depict the future of programming, yet the reality is that C and C++ will remain integral to many systems for years to come. The industry’s collective efforts to secure these older codebases indicate a recognition of their continued significance coupled with a commitment to improving their safety standards.

Engage with Us!

What are your thoughts on the balance between adopting new programming languages and securing legacy systems? Share your insights and experiences in the comments below. For further detailed reading, check out more articles on related topics at Shorty-News, or explore authoritative sources like TechCrunch, The Verge, and Wired.

By understanding and addressing memory safety vulnerabilities, companies like Google not only protect their applications but also pave the way for a more secure future in the technology landscape.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.