Skip to contentSkip to conversation

pnfsd: Prevent ipv6 address truncation in /proc/fs/nfsd/pnfs_dlm_device

PATCH In review Michael Groshans 2 participants 2 messages May 31, 2011 – Jun 1, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pnfsd: Prevent ipv6 address truncation in /proc/fs/nfsd/pnfs_dlm_device

From: Michael Groshans <[email protected]>

ipv6 addresses in /proc/fs/nfsd/pnfs_dlm_device were being truncated because the length was determined by looking for the next colon. Changed to use strlen() instead.

Signed-off by: Michael Groshans <[email protected]>

---
 fs/nfsd/nfs4pnfsdlm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4pnfsdlm.c +1 -1
index 006ded5..0068ba0 100644
@@ -165,7 +165,7 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len)
 
 	/* data server list */
 	/* FIXME: need to check for comma separated valid ip format */
-	len = strcspn(bufp, ":");
+	len = strlen(bufp);
 	if (len > NFSD_DLM_DS_LIST_MAX)
 		goto out_free;
 	memcpy(new->ds_list, bufp, len);
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 7 lines · Michael Groshans

From: Michael Groshans <[email protected]>

ipv6 addresses in /proc/fs/nfsd/pnfs_dlm_device were being truncated because the length was determined by looking for the next colon. Changed to use strlen() instead.

Signed-off by: Michael Groshans <[email protected]>

All 3 patches look good to me.
For easier patch management, next time it would be good to send all three as replies to an introductory message,

Also, please use "Signed-off-by:" rather than "Signed-off by:". Besides the fact that checkpatch warns about that I'm not sure it gets tracked properly...
I'll fix that before committing.

Thanks!

Benny

Quoted 17 lines
---
 fs/nfsd/nfs4pnfsdlm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4pnfsdlm.c +1 -1
index 006ded5..0068ba0 100644
@@ -165,7 +165,7 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len)
 
 	/* data server list */
 	/* FIXME: need to check for comma separated valid ip format */
-	len = strcspn(bufp, ":");
+	len = strlen(bufp);
 	if (len > NFSD_DLM_DS_LIST_MAX)
 		goto out_free;
 	memcpy(new->ds_list, bufp, len);