lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <a67d93f2-ea36-b399-0843-8cd8fc190bfd@nokia.com>
Date:   Tue, 26 Jun 2018 15:25:41 +0300
From:   Tommi Rantala <tommi.t.rantala@...ia.com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>
Cc:     linux-kernel@...r.kernel.org
Subject: perf trace --no-syscalls -e rcu:* -- garbage in output

Hi,

There some garbage in perf trace output, when tracing some rcu 
tracepoints (kernel is configured with CONFIG_RCU_TRACE=y).

For example in rcu:rcu_callback, instead of getting proper rcuname in 
the first "%s" here, there's garbage:

$ tail -1 /sys/kernel/debug/tracing/events/rcu/rcu_callback/format
print fmt: "%s rhp=%p func=%pf %ld/%ld", REC->rcuname, REC->rhp, 
REC->func, REC->qlen_lazy, REC->qlen

$ ./perf trace --no-syscalls -e 'rcu:*' -- sleep 1 2>&1 | od -t c

0000000                       0   .   0   0   0       r   c   u   :   r
0000020   c   u   _   c   a   l   l   b   a   c   k   : 200 351 345 215
0000040 377 377 377 377       r   h   p   =   0   x   f   f   f   f   8
0000060   d   5   5   8   f   5   b   0   1   0   0       f   u   n   c
0000100   =   f   i   l   e   _   f   r   e   e   _   r   c   u       0
0000120   /   1  \n                       0   .   0   0   8       r   c
0000140   u   :   r   c   u   _   d   y   n   t   i   c   k   : 373 217
0000160 276 215 377 377 377 377       4   0   0   0   0   0   0   0   0
0000200   0   0   0   0   0   0   0       4   0   0   0   0   0   0   0
0000220   0   0   0   0   0   0   0   2       0   x   1   d   2  \n
0000240                   0   .   0   2   3       r   c   u   :   r   c
0000260   u   _   d   y   n   t   i   c   k   : 023 220 276 215 377 377
0000300 377 377       4   0   0   0   0   0   0   0   0   0   0   0   0
0000320   0   0   2       4   0   0   0   0   0   0   0   0   0   0   0
0000340   0   0   0   0       0   x   1   d   2  \n
0000360   0   .   0   2   8       r   c   u   :   r   c   u   _   d   y
0000400   n   t   i   c   k   : 373 217 276 215 377 377 377 377       4
0000420   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
0000440   4   0   0   0   0   0   0   0   0   0   0   0   0   0   0   2
0000460       0   x   1   d   2  \n                       0   .   0   3
[...]


If I got it right, "pevent" in print_str_arg() is zero-initialized 
(pevent->long_size is zero...), causing "%s" format to produce garbage 
bytes instead of the proper string.

-Tommi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ