VYPR
Unrated severityNVD Advisory· Published May 2, 2005· Updated Jun 16, 2026

CVE-2005-0529

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

3
  • Linux/Kernel3 versions
    cpe:2.3:o:linux:linux_kernel:2.6.10:*:*:*:*:*:*:*+ 2 more
    • cpe:2.3:o:linux:linux_kernel:2.6.10:*:*:*:*:*:*:*
    • cpe:2.3:o:linux:linux_kernel:2.6.11_rc1_bk6:*:*:*:*:*:*:*
    • (no CPE)range: 2.6.10, 2.6.11rc1-bk6

Patches

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

News mentions

0

No linked articles in our index yet.