patch-1.3.25 linux/net/core/iovec.c

Next file: linux/net/ipv4/arp.c
Previous file: linux/net/core/dev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.24/linux/net/core/iovec.c linux/net/core/iovec.c
@@ -50,12 +50,16 @@
 	
 	for(ct=0;ct<m->msg_iovlen;ct++)
 	{
-		err=verify_area(mode, m->msg_iov[ct].iov_base, m->msg_iov[ct].iov_len);
+		err=verify_area(VERIFY_READ, &m->msg_iov[ct], sizeof(struct iovec));
 		if(err)
 			return err;
-		len+=m->msg_iov[ct].iov_len;
+		memcpy_fromfs(&iov[ct], &m->msg_iov[ct], sizeof(struct iovec));
+		err=verify_area(mode, iov[ct].iov_base, iov[ct].iov_len);
+		if(err)
+			return err;
+		len+=iov[ct].iov_len;
 	}
-	
+	m->msg_iov=&iov[0];
 	return len;
 }
 

FUNET's LINUX-ADM group, [email protected]
TCL-scripts by Sam Shen, [email protected] with Sam's (original) version
of this