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
This commit is contained in:
Paul Saab 2005-01-05 23:21:13 +00:00
parent 898b0535b7
commit b6e223d8d4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=139744

View File

@ -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,