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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <493161DE.6000703@gmail.com>
Date:	Sat, 29 Nov 2008 10:38:06 -0500
From:	roel kluin <roel.kluin@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] relay: When unsigned ret cannot store a negative value

When unsigned ret cannot store a negative value

Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
UNTESTED! is this the way to go?

diff --git a/kernel/relay.c b/kernel/relay.c
index 32b0bef..c9d62e5 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -1220,7 +1220,8 @@ static int subbuf_splice_actor(struct file *in,
 			       unsigned int flags,
 			       int *nonpad_ret)
 {
-	unsigned int pidx, poff, total_len, subbuf_pages, nr_pages, ret;
+	unsigned int pidx, poff, total_len, subbuf_pages, nr_pages;
+	ssize_t ret;
 	struct rchan_buf *rbuf = in->private_data;
 	unsigned int subbuf_size = rbuf->chan->subbuf_size;
 	uint64_t pos = (uint64_t) *ppos;
@@ -1289,7 +1290,8 @@ static int subbuf_splice_actor(struct file *in,
 	if (!spd.nr_pages)
 		return 0;
 
-	ret = *nonpad_ret = splice_to_pipe(pipe, &spd);
+	ret = splice_to_pipe(pipe, &spd);
+	*nonpad_ret = ret;
 	if (ret < 0 || ret < total_len)
 		return ret;
 


--
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