vendor:
N/A
by:
Project Zero
8,8
CVSS
HIGH
Buffer Overflow
120
CWE
Product Name: N/A
Affected Version From: N/A
Affected Version To: N/A
Patch Exists: YES
Related CWE: N/A
CPE: N/A
Metasploit:
N/A
Other Scripts:
N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References:
N/A
Nuclei Metadata: N/A
Platforms Tested: N/A
2017
mach_ports_register is a kernel task port MIG method
When the kernel process this ool ports descriptor in ipc_kmsg_copyin_ool_ports_descriptor it will kalloc a buffer large enough for all the ports and then copyin and convert them all. It does this using the init_port_set.count value, not init_port_setCnt. The generated MIG code however calls mach_ports_register like this without verifying that In0P->init_port_setCnt is equal to init_port_set.count, which leads to a buffer overflow vulnerability.
Mitigation:
Ensure that the init_port_setCnt value is equal to init_port_set.count before calling mach_ports_register.