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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-14e4d7e0abfdefabea2b8796c5a8b2b9c77b5326@git.kernel.org>
Date:   Mon, 13 Feb 2017 22:40:39 -0800
From:   "tip-bot for Steven Rostedt (VMware)" <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     namhyung@...nel.org, jolsa@...nel.org, tglx@...utronix.de,
        acme@...hat.com, hpa@...or.com, wangnan0@...wei.com,
        mingo@...nel.org, linux-kernel@...r.kernel.org,
        rostedt@...dmis.org, dsahern@...il.com, adrian.hunter@...el.com
Subject: [tip:perf/core] tools lib traceevent: Initialize lenght on
 OLD_RING_BUFFER_TYPE_TIME_STAMP

Commit-ID:  14e4d7e0abfdefabea2b8796c5a8b2b9c77b5326
Gitweb:     http://git.kernel.org/tip/14e4d7e0abfdefabea2b8796c5a8b2b9c77b5326
Author:     Steven Rostedt (VMware) <rostedt@...dmis.org>
AuthorDate: Mon, 13 Feb 2017 12:11:44 -0500
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 13 Feb 2017 17:22:32 -0300

tools lib traceevent: Initialize lenght on OLD_RING_BUFFER_TYPE_TIME_STAMP

A undefined value was being used for the OLD_RING_BUFFER_TYPE_TIME_STAMP
case entry, as the 'length' variable was not being initialized, fix it.

Caught by the reporter when building tools/perf/ using clang, which emmitted
this warning:

  kbuffer-parse.c:312:7: warning: variable 'length' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
          case OLD_RINGBUF_TYPE_TIME_EXTEND:
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  kbuffer-parse.c:339:29: note: uninitialized use occurs here
          kbuf->next = kbuf->index + length;
                                   ^~~~~~
  kbuffer-parse.c:297:21: note: initialize the variable 'length' to silence this warning
          unsigned int length;
                             ^
                              = 0

Reported-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/r/20170213121418.47f279e8@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/lib/traceevent/kbuffer-parse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/traceevent/kbuffer-parse.c b/tools/lib/traceevent/kbuffer-parse.c
index 65984f1..c94e364 100644
--- a/tools/lib/traceevent/kbuffer-parse.c
+++ b/tools/lib/traceevent/kbuffer-parse.c
@@ -315,6 +315,7 @@ static unsigned int old_update_pointers(struct kbuffer *kbuf)
 		extend += delta;
 		delta = extend;
 		ptr += 4;
+		length = 0;
 		break;
 
 	case OLD_RINGBUF_TYPE_TIME_STAMP:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ