Re: Serious locking bug in Linux NFS

H.J. Lu (hjl@lucon.org)
Sat, 17 Oct 1998 14:30:31 -0700 (PDT)


>
> > > Here is the relevant code:
>
> > > if (lp->addr.s_addr != sin->sin_addr.s_addr)
> > > dprintf(L_WARNING, "address mismatch: "
> > > "expected %s, got %s\n",
> > > inet_ntoa(lp->addr),
> > > inet_ntoa(sin->sin_addr));
>

Ooops. Here is a patch for knfsd 981014.

H.J.

---
Index: utils/statd/rmtcall.c
===================================================================
RCS file: /home/work/cvs/linux/knfsd/utils/statd/rmtcall.c,v
retrieving revision 1.3
diff -u -p -r1.3 rmtcall.c
--- rmtcall.c	1998/08/31 18:51:50	1.3
+++ rmtcall.c	1998/10/17 21:27:30
@@ -210,11 +210,15 @@ recv_rply(int sockfd, struct sockaddr_in
 	for (lp = notify; lp != NULL; lp = lp->next) {
 		if (lp->xid != xid)
 			continue;
-		if (lp->addr.s_addr != sin->sin_addr.s_addr)
+		if (lp->addr.s_addr != sin->sin_addr.s_addr) {
+			char addr [18];
+			strncpy (addr, inet_ntoa(lp->addr),
+				 sizeof (addr) - 1);
+			addr [sizeof (addr) - 1] = '\0';
 			dprintf(L_WARNING, "address mismatch: "
 				"expected %s, got %s\n",
-				inet_ntoa(lp->addr),
-				inet_ntoa(sin->sin_addr));
+				addr, inet_ntoa(sin->sin_addr));
+		}
 		if (lp->port == 0) {
 			if (!xdr_u_long(xdrs, portp)) {
 				log(L_WARNING, "recv_rply: [%s] "

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/