patch-2.4.23 linux-2.4.23/fs/proc/generic.c

Next file: linux-2.4.23/fs/proc/inode.c
Previous file: linux-2.4.23/fs/proc/base.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/fs/proc/generic.c linux-2.4.23/fs/proc/generic.c
@@ -150,13 +150,14 @@
 			offset += file->f_pos;
 	}
 	retval = -EINVAL;
-	if (offset>=0 && offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) {
+	if (offset>=0 && (unsigned long long)offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) {
 		if (offset != file->f_pos) {
 			file->f_pos = offset;
 			file->f_reada = 0;
 		}
 		retval = offset;
 	}
+	/* RED-PEN user can fake an error here by setting offset to >=-4095 && <0  */
 	return retval;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)