vsnprintf returns the number of chars that would have been written, not
the actual number of chars written. This can lead to crashlog_buf->len
being too big which in turn can lead to get_maxlen() returning negative
numbers. The length argument of kmsg_dump_get_buffer will be casted to
a size_t which makes a negative input a big positive number allowing
kmsg_dump_get_buffer to write out of bounds.
Fix this by using vscnprintf which returns the actually written number
of chars.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
SVN-Revision: 37820
This is crashing the kernel in crashlog_init_fs(), until fixed, disable it
for SPARC too.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 34213
kmsg_dump() uses an iterator to receive log buffer
content since 3.5. Change the 'crashlog_do_dump'
function in order to make it compatible with the
new version.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 33970