Linux Drops strncpy API After Six-Year Effort
A Long and Complex Cleanup Process
The Linux kernel has finally eliminated the strncpy API in its latest version, 7.2, after a six-year cleanup process. This change was made possible by the efforts of kernel developers who worked to remove the deprecated function. The removal was completed on 20 June 2026.
Breaking news:
The strncpy() function, used for copying a specified number of bytes, had been deprecated for a long time. Its removal required hundreds of patches to address all instances of its use within the kernel.
The process of eliminating strncpy was complex and time-consuming, involving a significant number of patches - 360 in total. This effort demonstrates the meticulous approach taken by Linux kernel maintainers to improve the kernel's quality and security.
Is the Linux Kernel Now Safer?
With the removal of strncpy, the Linux kernel is expected to be more secure, as the function had been identified as a potential source of vulnerabilities. The elimination of this deprecated API reduces the risk of buffer overflow attacks and other security issues.
The removal of strncpy from the Linux kernel marks a significant milestone in the ongoing effort to improve the kernel's security and reliability. As the Linux kernel continues to evolve, such cleanups will remain essential to its long-term health.
Frequently Asked Questions
What was the main reason for removing strncpy from the Linux kernel? The strncpy function was deprecated due to its potential to cause security vulnerabilities, such as buffer overflows.
How long did it take to remove strncpy from the Linux kernel? The removal process took six years, involving 360 patches to address all instances of its use.
What are the expected benefits of removing strncpy? The removal is expected to improve the security and reliability of the Linux kernel by reducing the risk of buffer overflow attacks and other security issues.
More stories: