diff -urpPX nopatch linux-2.4.33/fs/proc/generic.c linux/fs/proc/generic.c --- linux-2.4.33/fs/proc/generic.c Wed Jan 19 17:10:11 2005 +++ linux/fs/proc/generic.c Sun Aug 13 20:59:16 2006 @@ -62,11 +62,17 @@ proc_file_read(struct file * file, char if (!(page = (char*) __get_free_page(GFP_KERNEL))) return -ENOMEM; + if (pos < 0 || pos >= MAX_NON_LFS) + eof = 1; + else if (nbytes > MAX_NON_LFS - pos) + nbytes = MAX_NON_LFS - pos; + while ((nbytes > 0) && !eof) { - count = MIN(PROC_BLOCK_SIZE, nbytes); - if ((unsigned)pos > INT_MAX) + /* This is redundant, but better safe than sorry */ + if (pos < 0 || pos >= MAX_NON_LFS) break; + count = MIN(PROC_BLOCK_SIZE, nbytes); start = NULL; if (dp->get_info) {