Skip to content
Memory corruption Write-up Advanced

Solving “Copy Fail” CVE-2026–31431 Q/A Lab

The algif_aead receive path was written as if the AEAD operation ran in place, treating the TX scatter-gather list (source) and RX scatter-gather list (destination) as one shared buffer. A local unprivileged user could drive this path through the AF_ALG socket interface, though the text does not state a concrete exploit outcome.

medium.com

Published on medium.com

This writeup covers my solution for the Linux Kernel algifaead Cross-Mapping In-Place AEAD (“Copy Fail”) lab.

Kiranghimire, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The code assumed the AEAD operation could run in place, treating the TX and RX scatter-gather lists as one shared buffer when they are actually separate mappings.

Impact

A local unprivileged user could reach the vulnerable kernel path through the AF_ALG interface, but the text does not describe a concrete exploit outcome such as memory corruption or privilege escalation.

What the attacker needed

Local unprivileged shell on vulnerable kernel

The fix

The fix reverts the in-place model so the TX scatter-gather list stays the source and the RX scatter-gather list stays the destination, with no chaining or offsets between them.

How it was found

  1. Open an AF_ALG socket.
  2. Bind it to the gcm(aes) cipher.
  3. Set the key and authentication size with setsockopt.
  4. Accept the socket.
  5. Send the additional authenticated data and payload with sendmsg.
  6. Trigger the vulnerable receive path with recvmsg.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The kernel's crypto socket interface has two separate memory areas: one for data you send in and one for data you receive back. The buggy code pretended these were the same area, which is a wrong assumption about how memory is organised. A local user could reach this code through a normal crypto socket, but the text does not say what damage results.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.