Commit 7b08cf62 authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields
Browse files

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: 6019ce07 ("NFSD: Add a tracepoint to record directory entry encoding")
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent e34c0ce9
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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,