diff options
author | Tony Jones <tonyj@suse.de> | 2019-08-07 15:14:46 +0300 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-08-07 08:24:10 -0400 |
commit | 1375d98d8017e371776adbef10122a57ce2100e5 (patch) | |
tree | 9cd14c84bdcec9750803554e59b6af7c24020322 | |
parent | 8ba49dad8877fbd27cd6659397a01fb9243f7953 (diff) | |
download | trace-cmd-1375d98d8017e371776adbef10122a57ce2100e5.tar.gz |
tools lib traceevent: Fix buffer overflow in arg_eval
Fix buffer overflow observed when running perf test.
The overflow is when trying to evaluate "1ULL << (64 - 1)" which is
resulting in -9223372036854775808 which overflows the 20 character
buffer.
If is possible this bug has been reported before but I still don't see
any fix checked in:
See: https://www.spinics.net/lists/linux-perf-users/msg07714.html
Link: http://lore.kernel.org/linux-trace-devel/20190807121446.1833-1-tz.stoyanov@gmail.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204517
Reported-by: Michael Sartain <mikesart@fastmail.com>
Reported-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Tony Jones <tonyj@suse.de>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Fixes: f7d82350e597 ("tools/events: Add files to create libtraceevent.a")
Link: http://lkml.kernel.org/r/20190228015532.8941-1-tonyj@suse.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r-- | lib/traceevent/event-parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c index 7cb2ae42..b36b536a 100644 --- a/lib/traceevent/event-parse.c +++ b/lib/traceevent/event-parse.c @@ -2456,7 +2456,7 @@ static int arg_num_eval(struct tep_print_arg *arg, long long *val) static char *arg_eval (struct tep_print_arg *arg) { long long val; - static char buf[20]; + static char buf[24]; switch (arg->type) { case TEP_PRINT_ATOM: |