blktrace: NUL-terminate user space messages
authorCarl Henrik Lunde <chlunde@ping.uio.no>
Fri, 3 Apr 2009 12:27:15 +0000 (14:27 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 3 Apr 2009 12:46:22 +0000 (14:46 +0200)
commita4b3ada83d06554d307dd54abdc62b2e5648264a
tree70413a3343c8a40a8d3b22ec6d020ef806ca7a9b
parent18cea4591a98817697017bcb056a848bae1205df
blktrace: NUL-terminate user space messages

Impact: fix corrupted blkparse output

Make sure messages from user space are NUL-terminated strings,
otherwise we could dump random memory to the block trace file.

Additionally, I've limited the message to BLK_TN_MAX_MSG-1
characters, because the last character would be stripped by
vscnprintf anyway.

Signed-off-by: Carl Henrik Lunde <chlunde@ping.uio.no>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: "Alan D. Brunelle" <alan.brunelle@hp.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20090403122714.GT5178@kernel.dk>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/blktrace.c