summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-01-05 23:21:13 +0000
committerps <ps@FreeBSD.org>2005-01-05 23:21:13 +0000
commit86f9a5d44a7e1e5f41826eda9ba8d92c631f162a (patch)
treee1dafb1ae5118ce0a395d4d693543e2ea7d9c6b7
parent362fcfc1e268b4cff39cae1448f01c51def69091 (diff)
downloadFreeBSD-src-86f9a5d44a7e1e5f41826eda9ba8d92c631f162a.zip
FreeBSD-src-86f9a5d44a7e1e5f41826eda9ba8d92c631f162a.tar.gz
If the NFS/TCP stream is out of sync between the client and server,
and if the client (erroneously) reads the RPC length as 0 bytes, the client can loop around in the socket callback. Explicitly check for the length being 0 case and teardown/re-connect. Submitted by: Mohan Srinivasan
-rw-r--r--sys/nfsclient/nfs_socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c
index 8a25ce1..2f44b3f 100644
--- a/sys/nfsclient/nfs_socket.c
+++ b/sys/nfsclient/nfs_socket.c
@@ -836,7 +836,7 @@ nfs_clnt_tcp_soupcall(struct socket *so, void *arg, int waitflag)
* This is SERIOUS! We are out of sync with the sender
* and forcing a disconnect/reconnect is all I can do.
*/
- if (len > NFS_MAXPACKET) {
+ if (len > NFS_MAXPACKET || len == 0) {
log(LOG_ERR, "%s (%d) from nfs server %s\n",
"impossible packet length",
len,
OpenPOWER on IntegriCloud