# Linus Torvalds removes dangerous functions from the Linux 7.4 kernel

> Linus Torvalds signs a series of 48 patches that removes the unsafe variants of get_user and put_user in Linux 7.4, spanning 50 files and 801 fewer lines.
> By José Maldonado · Technology · 2026-10-23

Linus Torvalds rarely writes code relevant to the Linux kernel, which is why the operation of October 21, 2026 has something of an exception about it. That day he merged into his own tree a series of 48 patches signed by him, all destined for version 7.4 of the kernel, which had begun receiving changes two days earlier. What those patches remove are the two primitives with which the kernel poked around in programs' memory, \`\_\_get\_user()\` and \`\_\_put\_user()\`.

It is worth knowing what they did. The kernel runs with privileges and applications do not, so every time the former reads or writes the latter's memory it goes through an address check. These two variants skipped that check and assumed the previous call had already done it. The merge touches 50 files, with 689 lines added and 801 deleted.

The detail that gets lost in the headline is that the normal functions do not disappear, only the double-underscore family, the one that verified nothing and therefore allowed reading or writing where it should not. Torvalds sums it up in the merge message with a blunt phrase: used wrongly, and in his view they were always used wrongly, they were slower and also unsafe. That check they saved was good practice for years, which is why the cleanup arrives a decade late.

## Fifty files and a branch called uaccess-cleanups

The reference commit is [22a78a25438d](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=22a78a25438d), a merge with the subject "Merge \\\_\\\_{get,put}\\\_user() removal branch" that Torvalds signed as author and as integrator on October 21, 2026, at 07:19 his time, Hawaii time. The branch is called uaccess-cleanups and groups 48 commits that touch ARM, powerpc and x86 in addition to half a dozen minor architectures.

The calendar helps place the maneuver. [Linux 7.3 came out on Sunday, October 18, 2026](https://lore.kernel.org/all/CAHk-=wgwnBm2zDdRM7u016NVHkv9KqbZW7AZ=8wZrqGyv_V+5A@mail.gmail.com/), at the end of a nine-week cycle, and the announcement warned that Monday would open the 7.4 merge window and that its author would be on family vacation during those days.

## What separates the kernel from other programs' memory?

A program can ask the operating system to read or write at any address. If the kernel simply accepted a pointer arriving from user space, an application could slip in the address of its own structures and gain privileges. That is why the normal functions first check that the range falls on the permitted side.

The double-underscore variants skipped that first step. They were designed for code that had already validated the range and wanted to perform several consecutive reads on the same base, so that the check was paid only once. The saving depended on the prior validation existing.

The merge message is explicit about what happened when it did not exist: besides being slower than the modern path, they did not check the user address range. An interface that invites this kind of mistake ends up generating code that compiles without warning and hides the flaw until someone exploits it.

The modern alternative groups accesses into blocks with a start and an end, so that the closing is guaranteed whether the path ends well or ends in error. That is the change that made the rest possible.

## The four reasons that stopped holding

The merge message does not limit itself to saying the old interface was superfluous. It reviews the reasons it had been used for years and explains what happened to each of them, without embellishment.

Historical reason

Why it stopped holding

What is used instead

Performance when reading several times from the same base

The real cost is not the check, but enabling and disabling access

Scoped blocks, such as \`scoped\_user\_read\_access()\`

Access to an unreliable kernel pointer during fault handling

A specific helper for that case already exists

\`get\_kernel\_nofault()\`

Avoiding the \`might\_fault()\` warning in atomic regions

That region must explicitly disable page faults

\`pagefault\_disable()\`

Pointers that could be kernel or user

Almost all those cases had been removed earlier

Explicit accesses depending on the origin

The first row is the most interesting, because it was the serious technical argument in favor of the primitives for years. One check followed by many unchecked reads generated smaller and faster code on older machines.

The keyword Torvalds uses is "used to", because on current hardware the real expense is not in the range, but in turning access to user space on and off, which on x86 is done with the STAC and CLAC instructions.

That is where scoped blocks change the economics of the matter. If the price is paid when opening the block and not on each read, the unchecked variant loses its advantage and only its risk remains. The third row reveals a less confessable motive, that of code that silenced a kernel warning instead of fixing what the warning pointed to.

## An example converted by Claude

The origin of the series was a loose patch, not a cleanup campaign. Torvalds wrote it as a sample of how to convert those calls to the modern form, so that others would see the pattern and copy it. The sample caught on and ended up as a series touching half a hundred files.

The definitive push came from others' work. [Thomas Gleixner added scoped access blocks in October 2025](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e497310b4ffb), a syntax that cleans up access on leaving the block both on the good path and on the error path, and which Torvalds cites as what removes any excuse for sticking with the old primitives.

In the merge message there is a confession of method: part of the work was done with Claude, which Torvalds describes as a luxury coccinelle script, that is, a tool for applying a pattern to many places without writing them one by one.

The 7.3 cycle, which arrived on October 18 with FailFS and with improvements for gaming with little VRAM according to [our launch summary](https://observatorioblockchain.com/en/technology/linux-7-3-failfs-scheduler-gaming-vram/), also brought abundant contributions assisted by language models, a detail LWN highlighted in its cycle roundup.

Replacing individual discipline with a mechanism that makes it unnecessary recurs in other projects. In the Rust ecosystem, the [dependency quarantine that Cargo activates in Rust 1.100](https://observatorioblockchain.com/en/cybersecurity/rust-1-100-cargo-cuarentena-dependencias/) imposes a minimum age on newly published packages so that no one has to watch the registry by hand.

## x86 loses the interface, the rest waits

The complete removal only occurs in one architecture. The message itself warns of this: the series removes all calls of that type from generic code, but the definitive deletion of the interface is done in x86, where the header loses most of its definitions and the assembly routines are trimmed.

In arm64 the two variants were identical to the normal functions, so they did not carry the old danger and there was no urgency. Any architecture that uses the generic user access file will continue calling its internal helper that way, and several kept legacy uses that Torvalds did not want to touch because he does not know them and they did not seem relevant to him.

That split has a practical consequence for anyone looking at the tree in the coming weeks. The normal functions are still there and are used daily, the old interface disappears where the most code used it and elsewhere the name survives as an internal detail.

## What the cleanup leaves in view

The change alters nothing for anyone using Linux on a laptop or a server, and that invisibility is the measure of its success. What is gone is a door that allowed writing unsafe code under the appearance of optimization, and with it the reason to debate each specific case for another decade.

The less lustrous part of the calendar remains. The merge entered a merge window that its own author warned could stretch out due to vacation, and the series was written with the help of a tool that applies patterns at scale. The next cleanup will look more like that than like the image of the maintainer rewriting the kernel by hand.
