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

Joyent SmartOS Hyprlofs FS IOCTL 32-bit File System Integer Overflow Privilege Escalation Vulnerability

A 32-bit length value supplied through the Hyprlofs ioctl is cast to a signed integer, so a large count wraps negative and slips past the size check. The oversized allocation then fails and the kernel writes through a NULL pointer, causing a panic and potentially allowing 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 32-bit 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 32-bit entry count is cast to a signed int, so the bounds check can be bypassed and the resulting allocation failure is not checked before use.

Impact

An attacker can cause a kernel panic and potentially escalate privileges to full kernel level if they can map the NULL page in userspace.

What the attacker needed

Local access to SmartOS; ability to open a Hyprlofs file descriptor; 32-bit data model path; ability to map the NULL page

How it was found

  1. Open a file descriptor to the Hyprlofs file system.
  2. Issue an ioctl with the HYPRLOFS_ADD_ENTRIES command using the 32-bit data model.
  3. Supply an entry count large enough to wrap to a negative value when cast to a signed integer.
  4. The wrapped count passes the maximum-params check and the size calculation overflows.
  5. The kernel allocation fails and returns NULL, which is used without a check, 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 program asks the operating system to reserve memory for a list of entries, and the size is worked out from a number the user controls. Because that number is treated as signed, a very large value turns negative and the safety check is fooled. The memory request then fails, and the kernel carries on using the empty result, which crashes the machine and could let a local attacker 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.