cd /news/artificial-intelligence/linus-torvalds-eliminates-unsafe-get… · home › topics › artificial-intelligence › article
[ARTICLE · art-155609] src=phoronix.com ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Linus Torvalds Eliminates Unsafe __get_user() __put_user() Functions In 7.4

Linus Torvalds merged a code branch removing the unsafe __get_user() and __put_user() kernel functions, completing the final removal of the whole interface for x86/x86_64 and clearing the functions from all generic Linux kernel code. Torvalds wrote in the Git merge that the functions are "entirely historical, and are never the [right] thing to use any more," adding that when misused they are "not only slower than the right thing, but also insecure because they don't check the user address range." Remnants remain in some other CPU architecture ports, including ARM64, where the functions already map to get_user() and put_user().

read3 min views2 publishedOct 22, 2026
Linus Torvalds Eliminates Unsafe __get_user() __put_user() Functions In 7.4
Image: Phoronix (auto-discovered)

Linus Torvalds continues with his recent uptick in kernel patches himself, assisted in part by AI with Claude Code. Merged today was removing the historical and unsafe __get_user() and __put_user() kernel functions.

Linus Torvalds merged his code branch removing the __get_user() and __put_user() functions inside the Linux kernel. These functions are the faster but less safe versions of get_user() and set_user() due to less safety checking. The __get_user() / get_user() function is used for copying a single simple variable from user-space to kernel-space while __put_user() / put_user() is used for writing a single variable from kernel space to user-space. The versions removed lack pointer validation checks making them unsafe. Linus describes their removal in the Git merge as:

"This is long over-due: the __get_user() and __put_user() functions are entirely historical, and are never the [right] thing to use any more. And when mis-used (read: every case) they are not only slower than the right thing, but also insecure because they don't check the user address range.

In

The functions are removed from all the generic Linux kernel code and completes the final removal of the whole interface for x86/x86_64. There are remnants remaining in some of the other CPU architecture ports due to some non-trivial cases or like ARM64 having their functions already map to get_user() and put_user().

For those wondering about Linus Torvalds' AI coding or not given his work last week with Linus Torvalds merged his code branch removing the __get_user() and __put_user() functions inside the Linux kernel. These functions are the faster but less safe versions of get_user() and set_user() due to less safety checking. The __get_user() / get_user() function is used for copying a single simple variable from user-space to kernel-space while __put_user() / put_user() is used for writing a single variable from kernel space to user-space. The versions removed lack pointer validation checks making them unsafe. Linus describes their removal in the Git merge as:

"This is long over-due: the __get_user() and __put_user() functions are entirely historical, and are never the [right] thing to use any more. And when mis-used (read: every case) they are not only slower than the right thing, but also insecure because they don't check the user address range.

Most of the usage sites have been converted long ago, but various left-overs remained. So this started out as a single patch that I wrote as a "show people how to convert __{get,put}_user() to modern code".

In particular, Thomas last year implemented the very nice new scoped user access region helpers (see commit e497310b4ffb: "uaccess: Provide scoped user access regions") that makes the modern interfaces particularly easy to use and really removes any excuse for the old horrors."

In

the Git merge, Torvalds went on to describe the issues and horrors of __get_user() and __put_user(). The functions are removed from all the generic Linux kernel code and completes the final removal of the whole interface for x86/x86_64. There are remnants remaining in some of the other CPU architecture ports due to some non-trivial cases or like ARM64 having their functions already map to get_user() and put_user().

For those wondering about Linus Torvalds' AI coding or not given his work last week with

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @linus torvalds 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/linus-torvalds-elimi…] indexed:0 read:3min 2026-10-22 · —