Skip to content
Memory corruption Advisory Advanced CVE-2016-8733

Joyent SmartOS Hyprlofs FS IOCTL Native File System Integer Overflow Privilege Escalation Vulnerability

An integer overflow in the Hyprlofs file system's ioctl handler lets a local user supply a length that wraps to a negative value, bypassing the size check and causing a huge allocation that returns NULL. The kernel then writes to the NULL page, causing a kernel panic and potentially enabling privilege escalation if the attacker maps the NULL page.

Tyler Bohan Follow

Originally disclosed on Cisco Talos

High 7.8 View original

An exploitable integer overflow exists in the Joyent SmartOS OS 20161110T013148Z Hyprlofs file system. The vulnerability is present in the Ioctl system call with the command HYPRLOFSADDENTRIES when dealing with native file systems.

Tyler Bohan, on Cisco Talos

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a signed/unsigned mismatch: the user-supplied unsigned length is stored in a signed int, so a large value wraps negative and passes the maximum-size check before being used in a size calculation and allocation.

Impact

A local attacker can cause a kernel panic and potentially escalate privileges by mapping the NULL page, though the text only claims this as a possibility.

What the attacker needed

Local access to SmartOS; permission to use Hyprlofs ioctl controls

How it was found

  1. Open a file descriptor to the Hyprlofs file system.
  2. Issue an ioctl with the HYPRLOFS_ADD_ENTRIES command and a crafted entries buffer.
  3. Set the entry count large enough that it wraps to a negative signed integer.
  4. The wrapped value passes the maximum-params check and produces a huge allocation size.
  5. The allocation fails and returns NULL, which the kernel then writes to, causing a panic.

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 report has not been written yet. The Original tab links to the source.

A file system driver in the operating system kernel takes a number from a user program and uses it to work out how much memory to reserve. Because of a type conversion mistake, a very large number becomes negative, so the safety check is skipped and the memory request fails, leaving an empty pointer that the kernel then writes to. That crashes the machine and, in the right setup, could let a local user gain higher privileges.

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.

More by Tyler Bohan

View all

84 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

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.