tracing: Fix tracing buffer length in tracing_mark_write
PATCH 1/1 tracing: Fix tracing buffer length in tracing_mark_write
__copy_from_user_inatomic() return the byte length that copied failed, tracing buffer should left this bytes.
Fixes 656c7f0d2d2b ("tracing: Replace kmap with copy_from_user() in trace_marker writing")
Signed-off-by Wang ShaoBo <[email protected]>
--- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace.c +1 -1
@@ -6628,7 +6628,7 @@ tracing_mark_write(struct file *filp, const char __user *ubuf, written = -EFAULT ; }else written = cnt; - len = cnt; + cnt -= len;if (tr->trace_marker_file && !list_empty (&tr->trace_marker_file->triggers)) {/* do not add \n before testing triggers, but add \0 */
Signature · 1 line
2.17.1