[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200623085218.26426-1-bobo.shaobowang@huawei.com>
Date: Tue, 23 Jun 2020 16:52:18 +0800
From: Wang ShaoBo <bobo.shaobowang@...wei.com>
To: unlisted-recipients:; (no To-header on input)
CC: <rostedt@...dmis.org>, <mingo@...hat.com>,
<linux-kernel@...r.kernel.org>, <cj.chengjian@...wei.com>,
<xiexiuqi@...wei.com>, <bobo.shaobowang@...wei.com>
Subject: [PATCH] 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 <bobo.shaobowang@...wei.com>
---
kernel/trace/trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 29615f15a820..ed5fe0f165e0 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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 */
--
2.17.1
Powered by blists - more mailing lists