Skip to content

Commit 7b08cf6

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
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: 6019ce0 ("NFSD: Add a tracepoint to record directory entry encoding") Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent e34c0ce commit 7b08cf6

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

fs/nfsd/trace.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ TRACE_EVENT(nfsd_dirent,
408408
__entry->ino = ino;
409409
__entry->len = namlen;
410410
memcpy(__get_str(name), name, namlen);
411-
__assign_str(name, name);
412411
),
413412
TP_printk("fh_hash=0x%08x ino=%llu name=%.*s",
414413
__entry->fh_hash, __entry->ino,

0 commit comments

Comments
 (0)