diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2021-06-25 11:12:49 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2021-07-06 20:14:44 -0400 |
commit | 7b08cf62b1239a4322427d677ea9363f0ab677c6 (patch) | |
tree | 54c15f34b4c5f4dcf454630185e2f8556b0ddddd /fs/nfsd | |
parent | e34c0ce9136a0fe96f0f547898d14c44f3c9f147 (diff) | |
download | linux-7b08cf62b1239a4322427d677ea9363f0ab677c6.tar.bz2 |
NFSD: Prevent a possible oops in the nfs_dirent() tracepoint
The double copy of the string is a mistake, plus __assign_str()
uses strlen(), which is wrong to do on a string that isn't
guaranteed to be NUL-terminated.
Fixes: 6019ce0742ca ("NFSD: Add a tracepoint to record directory entry encoding")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/trace.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index 10cc3aaf1089..adaec43548d1 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -408,7 +408,6 @@ TRACE_EVENT(nfsd_dirent, __entry->ino = ino; __entry->len = namlen; memcpy(__get_str(name), name, namlen); - __assign_str(name, name); ), TP_printk("fh_hash=0x%08x ino=%llu name=%.*s", __entry->fh_hash, __entry->ino, |