lkml.org 
[lkml]   [2004]   [Jan]   [18]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 18 Jan 2004 14:04:42 +0100
FromManfred Spraul <>
SubjectRe: [PATCH] sendfile calls lock_verify_area with wrong parameters
Manfred Spraul wrote:

>+	if (!ppos)
>+		ppos = &in_file->f_pos;
> 
>
Too early - in_file not yet initialized.

An updated (and tested with 2.6.1-mm4) patch is attached - sorry for the 
noise.

--
    Manfred
--- 2.6/fs/read_write.c	2004-01-17 12:19:38.000000000 +0100
+++ build-2.6/fs/read_write.c	2004-01-18 13:42:11.000000000 +0100
@@ -559,7 +559,9 @@
 		goto fput_in;
 	if (!in_file->f_op || !in_file->f_op->sendfile)
 		goto fput_in;
-	retval = locks_verify_area(FLOCK_VERIFY_READ, in_inode, in_file, in_file->f_pos, count);
+	if (!ppos)
+		ppos = &in_file->f_pos;
+	retval = locks_verify_area(FLOCK_VERIFY_READ, in_inode, in_file, *ppos, count);
 	if (retval)
 		goto fput_in;
 
@@ -588,9 +590,6 @@
 	if (retval)
 		goto fput_out;
 
-	if (!ppos)
-		ppos = &in_file->f_pos;
-
 	if (!max)
 		max = min(in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes);
 
\
 
 \ /
  Last update: 2005-03-22 13:00    [W:0.150 / U:0.160 seconds]
©2003-2008 Jasper Spaans