Skip to contentSkip to conversation

dlm: Fix uninitialised variable in receiving

PATCH New Patrick Caulfield 3 participants 4 messages Mar 13, 2007 – Mar 14, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dlm: Fix uninitialised variable in receiving

The length of the second element of the kvec array was not initialised before being added to the first one. This could cause invalid lengths to be passed to kernel_recvmsg

Signature · 8 lines
patrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lowcomms.patch
Type: text/x-patch
Size: 390 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070313/8a38a5bc/attachment.bin>
#1 lore raw

PATCH 1/1 dlm: Fix uninitialised variable in receiving

Quoted 14 lines · Patrick Caulfield

The length of the second element of the kvec array was not initialised before being added to the first one. This could cause invalid lengths to be passed to kernel_recvmsg

------------------------------------------------------------------------

fs/dlm/lowcomms-tcp.c +0 -0
index 07e0a12..9bfe7fb 100644

fs/dlm/lowcomms-tcp.c static int receive_from_sock(struct connection *con) · line 305

Quoted 7 lines
fs/dlm/lowcomms-tcp.c +1 -0
@@ -299,6 +299,7 @@ static int receive_from_sock(struct connection *con)
 	 */
 	iov[0].iov_len = con->cb.base - cbuf_data(&con->cb);
 	iov[0].iov_base = page_address(con->rx_page) + cbuf_data(&con->cb);
+	iov[1].iov_len = 0;
 	nvec = 1;
 
 	/*

ACK

This is a necessary fix.

Bob Peterson
Red Hat Cluster Suite

#2 lore raw

PATCH 1/1 dlm: Fix uninitialised variable in receiving

In reply to Patrick Caulfield
Quoted 14 lines · Patrick Caulfield

The length of the second element of the kvec array was not initialised before being added to the first one. This could cause invalid lengths to be passed to kernel_recvmsg

------------------------------------------------------------------------

fs/dlm/lowcomms-tcp.c +0 -0
index 07e0a12..9bfe7fb 100644

fs/dlm/lowcomms-tcp.c static int receive_from_sock(struct connection *con) · line 305

Quoted 7 lines
fs/dlm/lowcomms-tcp.c +1 -0
@@ -299,6 +299,7 @@ static int receive_from_sock(struct connection *con)
 	 */
 	iov[0].iov_len = con->cb.base - cbuf_data(&con->cb);
 	iov[0].iov_base = page_address(con->rx_page) + cbuf_data(&con->cb);
+	iov[1].iov_len = 0;
 	nvec = 1;
 
 	/*

Just to add that this is already in RHEL5, but it needs to go upstream.

Signature · 1 line
patrick