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
Gabor Juhos
d158dfc607
linux/3.3: disable crashlog on PPC
...
It causes NULL pointer dereference:
[ 0.638235] __ioremap(): phys addr 0x7f00000 is RAM lr c025d61c
[ 0.644090] Unable to handle kernel paging request for data at address 0x00000000
[ 0.651533] Faulting instruction address: 0xc025d620
[ 0.656483] Oops: Kernel access of bad area, sig: 11 [#1 ]
[ 0.661856] P1010 RDB
[ 0.664113] Modules linked in:
[ 0.667152] NIP: c025d620 LR: c025d61c CTR: c000dc38
[ 0.672101] REGS: c7831ef0 TRAP: 0300 Not tainted (3.3.8)
[ 0.677740] MSR: 00029000 <CE,EE,ME> CR: 42022082 XER: 20000000
[ 0.683817] DEAR: 00000000, ESR: 00000000
[ 0.687811] TASK = c782c000[1] 'swapper' THREAD: c7830000
[ 0.693017] GPR00: a1ee0000 c7831fa0 c782c000 00000000 0000214c ffffffff c7831ea6 0001ffff
[ 0.701350] GPR08: c03697cc c035fba0 c03697cc c0360000 42022022 00000000 00000000 00000000
[ 0.709682] GPR16: c0000a00 00000014 3fffffff 00ffa000 00000015 07fc42bc c0360000 00000000
[ 0.718015] GPR24: 00000000 00000000 00001680 c0360000 00000000 c025d5e8 c0390000 c038b824
[ 0.726535] NIP [c025d620] crashlog_init_fs+0x38/0xd8
[ 0.731560] LR [c025d61c] crashlog_init_fs+0x34/0xd8
[ 0.736503] Call Trace:
[ 0.738939] [c7831fa0] [c025d61c] crashlog_init_fs+0x34/0xd8 (unreliable)
[ 0.745712] [c7831fb0] [c0001e98] do_one_initcall+0xd4/0x198
[ 0.751357] [c7831fe0] [c02537f4] kernel_init+0x9c/0x120
[ 0.756647] [c7831ff0] [c000c2dc] kernel_thread+0x4c/0x68
[ 0.762022] Instruction dump:
[ 0.764975] 3860fff4 bfc10008 3fc0c039 90010014 3bfeb824 801f0004 2f800000 41be00a0
[ 0.772699] 7c030378 38804000 4bdb38cd 3c00a1ee <81630000> 6000dead 7c691b78 907eb824
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 35435
12 years ago
Florian Fainelli
8ad0b56ba5
do not build crashlog on sparc too
...
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
12 years ago
Gabor Juhos
b942309f4f
generic: use __meminit annotation for crashlog_init_memblock
...
Fixes this section mismatch warning:
WARNING: vmlinux.o(.meminit.text+0xb14): Section mismatch in reference
from the function memblock_insert_region() to the function
.init.text:crashlog_init_memblock()
The function __meminit memblock_insert_region() references
a function __init crashlog_init_memblock().
If crashlog_init_memblock is only used by memblock_insert_region then
annotate crashlog_init_memblock with a matching annotation.
Also, remove the __init annotations from 'include/linux/crashlog.h'
SVN-Revision: 33137
12 years ago
Florian Fainelli
c0561a42e7
disable crashlog on ARM platforms for the moment
...
It is currently badly broken on ARM, until fixed, disable it
SVN-Revision: 32926
12 years ago
Felix Fietkau
b59bc92c6e
crashlog: fix dependency, add memblock support
...
SVN-Revision: 32787
12 years ago
Jonas Gorski
eca9950f63
kernel: add preliminary support for linux 3.3
...
Based on 3.3-rc2
SVN-Revision: 29986
13 years ago
Jonas Gorski
1bc0abb058
kernel: add support for linux 3.2.1
...
SVN-Revision: 29730
13 years ago
Jonas Gorski
3e94ee9642
kernel: generic: refresh patches for 3.1-rc2
...
SVN-Revision: 28021
13 years ago
Jonas Gorski
cf2070bd5b
linux: generic: add support for 3.1-rc1
...
SVN-Revision: 27940
13 years ago
Hauke Mehrtens
1c0d5f5ae2
kernel: refresh patches for kernel 3.0-rc4
...
SVN-Revision: 27247
14 years ago
Hauke Mehrtens
235e331987
linux/generic: Add support for 3.0-rc3
...
Also make linux identify itself properly as 3.0, not 3.0.0.
Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com>
SVN-Revision: 27191
14 years ago
Felix Fietkau
127e4ebd32
generic: Add support for 2.6.39
...
Add support for 2.6.39 based on rc3. Runtime tested on bcm63xx.
SVN-Revision: 26615
14 years ago
Imre Kaloz
c700e57cc7
preliminary 2.6.38 support
...
SVN-Revision: 25057
14 years ago
Alexandros C. Couloumbis
ce0984ec5d
linux/generic: update & refresh 2.6.36 & 2.6.37. ( closes #8324 )
...
SVN-Revision: 24370
14 years ago
Alexandros C. Couloumbis
a2d17ea8cf
target/linux: add preliminary 2.6.37 kernel support
...
SVN-Revision: 23828
14 years ago
Hamish Guthrie
0dc830c8f1
kernel: crashlog uses bootmem to allocate memory which is being deprecated in favour of memblock. microblaze, sh, arm, sparc and powerpc only have memblock.
...
SVN-Revision: 23269
14 years ago
Alexandros C. Couloumbis
11c45f64fe
linux/generic: refresh 2.6.36 kernel patches
...
SVN-Revision: 23237
14 years ago
Alexandros C. Couloumbis
206e5f313e
linux/generic: add kernel 2.6.36 preliminary support
...
SVN-Revision: 22832
14 years ago
Florian Fainelli
083ff78000
crashlog depends on BOOTMEM
...
SVN-Revision: 22541
14 years ago
Felix Fietkau
9f6c22b497
kernel: add the new 'crashlog' feature, which tries to store kernel oops/panic logs in a fixed location in RAM to recover them after the reboot and make them available to user space using debugfs
...
SVN-Revision: 22305
15 years ago