tracing: do not leak kernel addresses
authorNick Desaulniers <ndesaulniers@google.com>
Fri, 3 Mar 2017 23:40:12 +0000 (15:40 -0800)
committerPDO SCM Team <hudsoncm@motorola.com>
Fri, 26 Feb 2021 06:18:20 +0000 (00:18 -0600)
This likely breaks tracing tools like trace-cmd.  It logs in the same
format but now addresses are all 0x0.

Bug: 34277115
MOT-CRs-fixed: (CR)

Change-Id: Ifb0d4d2a184bf0d95726de05b1acee0287a375d9
Reviewed-on: https://gerrit.mot.com/1887836
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@mt.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

kernel/trace/trace_printk.c

index ad1d6164e94603cf29f1b26f0a58f8c37988d57b..e82cff5c842c6e5c8ac961cd6beae0ab0a3ab304 100644 (file)
@@ -304,7 +304,7 @@ static int t_show(struct seq_file *m, void *v)
        if (!*fmt)
                return 0;
 
-       seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt);
+       seq_printf(m, "0x%lx : \"", 0L);
 
        /*
         * Tabs and new lines need to be converted.