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]
Date:	Wed, 9 Dec 2015 13:27:13 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	"David S. Miller" <davem@...emloft.net>,
	Asias He <asias@...hat.com>
Cc:	Ray Jui <rjui@...adcom.com>, Scott Branden <sbranden@...adcom.com>,
	Jon Mason <jonmason@...adcom.com>,
	Stefan Hajnoczi <stefanha@...hat.com>, netdev@...r.kernel.org,
	bcm-kernel-feedback-list@...adcom.com,
	kernel-janitors@...r.kernel.org
Subject: [patch -next] VSOCK: signedness bug in
 virtio_transport_dgram_enqueue()

"written" has to be signed for the error handling to work.
trans->ops->send_pkt() returns an int so that's fine.

Fixes: 80a19e338d45 ('VSOCK: Introduce virtio-vsock-common.ko')
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 28f790d..d9a2325 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -815,7 +815,8 @@ virtio_transport_dgram_enqueue(struct vsock_sock *vsk,
 		.type = VIRTIO_VSOCK_TYPE_DGRAM,
 		.msg = msg,
 	};
-	size_t total_written = 0, pkt_off = 0, written;
+	size_t total_written = 0, pkt_off = 0;
+	int written;
 	u16 dgram_id;
 
 	/* The max size of a single dgram we support is 64KB */
@@ -845,7 +846,7 @@ virtio_transport_dgram_enqueue(struct vsock_sock *vsk,
 		}
 		total_written += written;
 		pkt_off += written;
-		pr_debug("%s:id=%d, dgram_len=%zu, off=%zu, total_written=%zu, written=%zu\n",
+		pr_debug("%s:id=%d, dgram_len=%zu, off=%zu, total_written=%zu, written=%d\n",
 			  __func__, dgram_id, dgram_len, pkt_off, total_written, written);
 	}
 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ