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

Next file: linux/fs/proc/proc_tty.c
Previous file: linux/fs/proc/array.c
Back to the patch index
Back to the overall index

diff -urN v2.2.15/linux/fs/proc/generic.c linux/fs/proc/generic.c
@@ -198,9 +198,13 @@
 {
     switch (orig) {
     case 0:
+	if (offset < 0)
+	    return -EINVAL;    
 	file->f_pos = offset;
 	return(file->f_pos);
     case 1:
+	if (offset + file->f_pos < 0)
+	    return -EINVAL;    
 	file->f_pos += offset;
 	return(file->f_pos);
     case 2:

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