Commit Graph

3 Commits (f8aef84e49237ebc848c4b861628911d72f703f7)

Author SHA1 Message Date
Felix Fietkau 3848e6a246 kernel: crashlog: Avoid out-of-bounds write
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
11 years ago
Imre Kaloz c90078ce87 refresh patches against -rc4
SVN-Revision: 36127
11 years ago
Florian Fainelli b2e63b8ea8 kernel: add support for 3.9-rc2
Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 36008
11 years ago