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>] [day] [month] [year] [list]
Date:	Tue, 30 Mar 2010 12:42:09 +0300
From:	Dan Carpenter <error27@...il.com>
To:	Eric Van Hensbergen <ericvh@...il.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Abhishek Kulkarni <adkulkar@...il.iu.edu>,
	Sripathi Kodi <sripathik@...ibm.com>,
	Latchesar Ionkov <lucho@...kov.net>,
	Venkateswararao Jujjuri <jvrao@...ibm.com>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: [patch] 9p: saving negative to unsigned char

Saving -EINVAL as unsigned char truncates the high bits and changes it 
into 234 instead of -22.  This breaks the test for "if (ret == -EINVAL)"
in parse_opts().

Signed-off-by: Dan Carpenter <error27@...il.com>

diff --git a/net/9p/client.c b/net/9p/client.c
index e3e5bf4..edf31aa 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -71,9 +71,10 @@ inline int p9_is_proto_dotu(struct p9_client *clnt)
 EXPORT_SYMBOL(p9_is_proto_dotu);
 
 /* Interpret mount option for protocol version */
-static unsigned char get_protocol_version(const substring_t *name)
+static int get_protocol_version(const substring_t *name)
 {
-	unsigned char version = -EINVAL;
+	int version = -EINVAL;
+
 	if (!strncmp("9p2000", name->from, name->to-name->from)) {
 		version = p9_proto_legacy;
 		P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n");
--
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