lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1274885083-15735-1-git-send-email-xiaosuo@gmail.com>
Date:	Wed, 26 May 2010 22:44:43 +0800
From:	Changli Gao <xiaosuo@...il.com>
To:	Jens Axboe <axboe@...nel.dk>
Cc:	Alexander Viro <viro@...iv.linux.org.uk>,
	Miklos Szeredi <mszeredi@...e.cz>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Changli Gao <xiaosuo@...il.com>
Subject: [PATCH v2 4/4] splice: fix updating sd->pos wrongly

fix updating sd->pos wrongly.

In error path, we don't need to updating sd->pos, if the file isn't seekable.

Signed-off-by: Changli Gao <xiaosuo@...il.com>
----
 fs/splice.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/splice.c b/fs/splice.c
index 57172ca..c69b241 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1185,7 +1185,8 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 		sd->pos = pos;
 
 		if (ret < read_len) {
-			sd->pos = prev_pos + ret;
+			if (sd->pos)
+				sd->pos = prev_pos + ret;
 			goto out_release;
 		}
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ