pnfsd: Prevent ipv6 address truncation in /proc/fs/nfsd/pnfs_dlm_device
Subsystems (2)
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
@@ -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
Quoted 7 lines · Michael Groshans
From: Michael Groshans <[email protected]>
ipv6 addresses in
/proc/fs/nfsd/pnfs_dlm_devicewere being truncated because the length was determined by looking for the next colon. Changed to usestrlen()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@@ -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);