OpenBSD has a strong reputation for security, which makes Big Fish worth a look. Calif researcher Andrew Griffiths turned a bug that has sat in BSD code for about 37 years into a reliable root shell for any local user.

The bug

When a program attaches to a block of shared memory, the kernel counts how many processes are using it. In the original BSD sources that counter (shm_nattch) was a signed 16-bit number, so it can only reach 32,767. With enough processes attached, it rolls over to a negative number. The kernel then believes the memory is no longer in use and frees it while it is still in use: a use-after-free.

Impact

  • Local privilege escalation to root. An attacker needs to run code on the machine first, for example through a compromised service or user account.
  • The exploit works with OpenBSD’s protections switched on (KARL, SMAP and SMEP) and does not need a separate information leak.

The fix

OpenBSD fixed the issues in OpenBSD 7.9 errata 026 (sysvipc) and errata 018 (shmat). If you run OpenBSD, apply them with syspatch and reboot.

The bigger lesson: make kernels harder to exploit

Calif argues that patching single bugs is not enough, and suggests hardening that would make bugs like this much harder to use:

  • Safe unlinking in the kernel’s list and queue code.
  • Randomise kernel memory layout at boot. Today early allocations land at the same addresses on every boot of the same hardware.
  • Ship the array bounds checker in release kernels. Calif says it privately reported 21 issues that this check would have caught.
  • Keep allocations that hold pointers apart from those that do not, so one overflow cannot easily corrupt a pointer.

What this means for you

Old code is not safe code. Firewalls, routers and appliances built on BSD may carry the same decades-old logic, so keep their firmware updated, limit who can log in to them and run as few services as possible.

Not sure if this affects you? Talk to us and we will check your servers and network appliances and plan the update with you.

Source

This article summarises Big Fish: Exploiting a 37-Year-Old Kernel Bug in OpenBSD, published by Calif on 16 October 2026 (research by Andrew Griffiths). Read the original for the full technical details.