2 Commits
Author SHA1 Message Date
Carl Henrik Lunde a4b3ada83d 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 <[email protected]>
Cc: Li Zefan <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: "Alan D. Brunelle" <[email protected]>
Cc: Steven Rostedt <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
2009-04-03 14:46:22 +02:00
Carl Henrik Lunde 14a73f5479 block: disable IRQs until data is written to relay channel
As we may run relay_reserve from interrupt context we must always disable
IRQs.  This is because a call to relay_reserve may expose previously written
data to use space.

Updated new message code and an old but related comment.

Signed-off-by: Carl Henrik Lunde <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2008-06-12 11:20:57 -07:00