diff options
author | Vaibhav Nagarnaik <vnagarnaik@google.com> | 2011-06-20 20:19:38 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-06-29 11:26:53 -0400 |
commit | aac14bf600784eb13d24fc93ca1838a7c4f187df (patch) | |
tree | 9a9df33202b795f6f7d3dbfa942a4687a44d08fd /trace-cmd.c | |
parent | 1e57b57502e47eff379cfe8347bab61eadbcf3c0 (diff) |
trace-cmd: Add check for truncated files
If the trace data file that is being read is truncated, mmap'ing its
non-existent page does not give any error. When the page is read, the
process dies with a SIGBUS.
This patch adds a file size check while initializing the trace data and
makes sure that the file size matches the expected size; otherwise an
error is returned.
Cc: Michael Rubin <mrubin@google.com>
Cc: David Sharp <dhsharp@google.com>
Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
Link: http://lkml.kernel.org/r/1308615578-556-1-git-send-email-vnagarnaik@google.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-cmd.c')
0 files changed, 0 insertions, 0 deletions