Skip to content

Commit f501b6a

Browse files
deggemangregkh
authored andcommitted
debugfs: Fix debugfs_read_file_str()
Read the entire size of the buffer, including the trailing new line character. Discovered while reading the sched domain names of CPU0: before: cat /sys/kernel/debug/sched/domains/cpu0/domain*/name SMTMCDIE after: cat /sys/kernel/debug/sched/domains/cpu0/domain*/name SMT MC DIE Fixes: 9af0440 ("debugfs: Implement debugfs_create_str()") Reviewed-by: Steven Rostedt (VMware) <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Dietmar Eggemann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8124c8a commit f501b6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/debugfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ ssize_t debugfs_read_file_str(struct file *file, char __user *user_buf,
893893

894894
copy[copy_len] = '\n';
895895

896-
ret = simple_read_from_buffer(user_buf, count, ppos, copy, copy_len);
896+
ret = simple_read_from_buffer(user_buf, count, ppos, copy, len);
897897
kfree(copy);
898898

899899
return ret;

0 commit comments

Comments
 (0)