CVE-2005-0529
Description
Linux kernel 2.6.10 and 2.6.11rc1-bk6 uses different size types for offset arguments to the proc_file_read and locks_read_proc functions, which leads to a heap-based buffer overflow when a signed comparison causes negative integers to be used in a positive context.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
3Patches
Vulnerability mechanics
Root cause
"Signed type mismatch: `proc_file_read` casts `nbytes` to `ssize_t` (signed) while `locks_read_proc` uses `off_t` (signed long) instead of `loff_t` (long long), allowing negative offset/count values to cause a heap buffer overflow."
Attack vector
An attacker with local access can open `/proc/locks`, use `_llseek` to set a crafted negative offset (e.g., `0x80004242`), then call `read()` with a large positive count (e.g., `0x80004242`). The signed comparison in `proc_file_read` treats the negative offset as a large positive value after truncation, causing `locks_read_proc` to write beyond the allocated heap buffer [ref_id=1][ref_id=2]. The advisory's PoC demonstrates this by creating many flocked files to exhaust file descriptors and then performing the seek/read sequence.
Affected code
The vulnerability involves `fs/proc/generic.c:63` in `proc_file_read()` where a signed cast `min_t(ssize_t, ...)` is used, and `locks_read_proc()` in the proc_misc code which uses `off_t off` (a signed long on i386) while the VFS layer uses `loff_t` (long long). The mismatch allows an attacker to supply negative offset and count values that sum to a positive value, triggering a heap-based buffer overflow [ref_id=1][ref_id=2].
What the fix does
The fix, available in Linux 2.6.11-rc4, addresses the signed type mismatch by adding checks at the VFS layer and in `copy_from_user` to prevent negative values from being interpreted as large positive sizes [ref_id=1][ref_id=2]. The individual patches (referenced via BitKeeper changesets) correct the type usage so that `off_t` and `ssize_t` are handled consistently, preventing the signed-to-unsigned conversion that allowed the heap overflow.
Preconditions
- authLocal access to the system
- inputAbility to open /proc/locks and perform llseek/read operations
Reproduction
The advisory includes a complete PoC program that opens `/proc/locks`, calls `_llseek(fd,42,0x80004242,&lr,SEEK_SET)`, then `read(fd,he2,0x80004242)`. It also creates many flocked files via forked processes to exhaust file descriptors before the exploit [ref_id=1][ref_id=2].
Generated on Jun 16, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- www.guninski.com/where_do_you_want_billg_to_go_today_3.htmlnvdExploitPatch
- distro.conectiva.com.br/atualizacoes/index.phpnvd
- linux.bkbits.net:8080/linux-2.6/cset%404201818eC6aMn0x3GY_9rw3ueb2ZWQnvd
- marc.infonvd
- marc.infonvd
- www.novell.com/linux/security/advisories/2005_18_kernel.htmlnvd
- www.redhat.com/support/errata/RHSA-2005-366.htmlnvd
- oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A8994nvd
News mentions
0No linked articles in our index yet.