Linux 7.2 kernel adopts zerocopy to cut unsafe Rust code
Linux 7.2 is pulling zerocopy into the kernel to replace more unsafe byte handling, with more than 40,000 Rust lines landing in the cycle.

Linux 7.2 is taking Rust deeper into the kernel’s most sensitive plumbing, and the newest push is centered on zerocopy. More than 40,000 new lines of Rust code have already landed for the cycle, and the headline change is a move to use zerocopy where the kernel has been doing low-level byte conversions and layout handling by hand.
That matters because zerocopy is built for exactly this kind of work. The crate is no_std by default, which fits kernel-adjacent environments, and the kernel’s Rust documentation says its casting macros do compile-time size and alignment checks. In practice, that means fewer handwritten unsafe memory manipulations and a cleaner path for turning byte sequences into typed structures without scattering conversion code across the tree.

Miguel Ojeda said he only needed “a couple small patches” to adapt zerocopy and zerocopy-derive for Linux kernel use, a sign that the kernel team is trying to stay close to upstream instead of forking the ecosystem. That approach should make the code easier to maintain over time, while still giving Rust-for-Linux a reusable foundation for future work in other high-risk paths.
The adoption also says a lot about where Rust in Linux stands now. Rust support first merged into mainline in Linux v6.1, and by the 2025 Linux Kernel Maintainers Summit the original Rust experiment had been declared concluded. What started as an experiment is now treated as a permanent part of kernel development, and zerocopy is a concrete example of that shift from symbolic adoption to practical replacement work.
The 7.2 cycle is not only about safety, either. The Rust changes also include AutoFDO support, software tag-based KASAN, and preparation for Rust 1.98. In early June, Ojeda also flagged a Rust compiler bug that had already been fixed in Rust 1.98.0, underlining how tightly kernel work now tracks compiler behavior. A Nova patch cited in the cycle removes one unsafe impl with zerocopy, and one isolated codegen example reportedly stayed essentially identical, with no remaining panics in that case.
For Rust readers watching Linux, the signal is clear: the momentum is no longer just that Rust is in the kernel. The real story is that kernel maintainers are now using mature Rust crates like zerocopy to shrink unsafe code in places where mistakes are most expensive, while building a reusable base for the next round of kernel Rust work.
This article was produced by Prism’s automated news system from verified source data, official records, and press releases, then run through automated quality and moderation checks before publishing. The system is built and supervised by the people who set the standards it runs under. Read our full AI policy.
Did this article answer your question?


