mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 15:19:51 +00:00
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>
This commit is contained in:
parent
e34c0ce913
commit
7b08cf62b1
@ -408,7 +408,6 @@ TRACE_EVENT(nfsd_dirent,
|
|||||||
__entry->ino = ino;
|
__entry->ino = ino;
|
||||||
__entry->len = namlen;
|
__entry->len = namlen;
|
||||||
memcpy(__get_str(name), name, namlen);
|
memcpy(__get_str(name), name, namlen);
|
||||||
__assign_str(name, name);
|
|
||||||
),
|
),
|
||||||
TP_printk("fh_hash=0x%08x ino=%llu name=%.*s",
|
TP_printk("fh_hash=0x%08x ino=%llu name=%.*s",
|
||||||
__entry->fh_hash, __entry->ino,
|
__entry->fh_hash, __entry->ino,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user