openwrtv4/target/linux
Jonas Gorski eed031d460 brcm63xx: brcm63xxpart: fix buffer overrun in of parser
We never account for the added partitions from the tag parser, so
allocated two partioness less than needed. This can cause issues when
the memory gets reused before the mtd code can actually add the
partitions.

Fixes oopses like:
[    0.920000] mtd: device 2 (rootfs) set to be root filesystem
[    0.924000] 1 squashfs-split partitions found on MTD device rootfs
[    0.932000] 0x0000002e0000-0x0000003f0000 : "rootfs_data"
[    0.940000] 0x000000010000-0x0000003f0000 : "linux"
[    0.948000] CPU 0 Unable to handle kernel paging request at virtual address 00010203, epc == 8028ddf8, ra == 801ad5d4
[    0.956000] Oops[#1]:
[    0.956000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.8 #22
[    0.956000] task: 8181da78 ti: 8181e000 task.ti: 8181e000
[    0.956000] $ 0   : 00000000 10008f00 00010203 81049e40
[    0.956000] $ 4   : 00010203 000000d0 00000000 000000fd
[    0.956000] $ 8   : 00000000 80015490 00000000 80370000
[    0.956000] $12   : 00000000 00000001 00000000 2f736269
[    0.956000] $16   : 00010203 000000d0 8007bde0 81482000
[    0.956000] $20   : 00000000 00000004 81481f80 803c4b78
[    0.956000] $24   : 00000000 00000000
[    0.956000] $28   : 8181e000 8181fbe8 80b20000 801ad5d4
[    0.956000] Hi    : 00000000
[    0.956000] Lo    : 00000000
[    0.956000] epc   : 8028ddf8 strlen+0x4/0x20
[    0.956000]     Not tainted
[    0.956000] ra    : 801ad5d4 kstrdup+0x30/0x84
[    0.956000] Status: 10008f03 KERNEL EXL IE
[    0.956000] Cause : 00800008
[    0.956000] BadVA : 00010203
[    0.956000] PrId  : 0002a010 (Broadcom BMIPS4350)
[    0.956000] Modules linked in:
[    0.956000] Process swapper/0 (pid: 1, threadinfo=8181e000, task=8181da78, tls=00000000)
[    0.956000] Stack : 8148aa00 803c4bcc 00000000 801cd9d0 00000000 8148a400 818a1400 003f0000
          81482000 8007bde0 8148aa00 800ac78c 8148aa00 00000004 8037ae30 8181fc4c
          8148aa00 803bc074 803c0000 80074b84 00000000 00010000 00000004 ffffffff
          8037ae30 00000004 8148aa00 00000004 803c4b80 818a1400 803c0000 00000005
          81481f80 80074ce0 8181fc84 00000005 81879800 8008ece4 00000000 003f0000
          ...
[    0.956000] Call Trace:
[    0.956000] [<8028ddf8>] strlen+0x4/0x20
[    0.956000] [<801ad5d4>] kstrdup+0x30/0x84
[    0.956000] [<8007bde0>] allocate_partition+0x58/0x93c
[    0.956000] [<80074ce0>] add_mtd_partitions+0x90/0x144
[    0.956000] [<801cc228>] mtd_device_parse_register+0x78/0xcc
[    0.956000] [<801e7870>] of_flash_probe+0x658/0x728
[    0.956000] [<80216ee0>] platform_drv_probe+0x24/0x60
[    0.956000] [<801221f4>] driver_probe_device+0xcc/0x214
[    0.956000] [<800466f8>] __driver_attach+0x7c/0xb4
[    0.956000] [<800c38bc>] bus_for_each_dev+0x94/0xa4
[    0.956000] [<800c35e4>] bus_add_driver+0x104/0x1ec
[    0.956000] [<80122400>] driver_register+0xac/0x100
[    0.956000] [<80113a5c>] do_one_initcall+0x148/0x204
[    0.956000] [<803cbd1c>] kernel_init_freeable+0x168/0x220
[    0.956000] [<800157bc>] kernel_init+0x10/0x114
[    0.956000] [<800108a8>] ret_from_kernel_thread+0x14/0x1c
[    0.956000]
[    0.956000]
Code: 03e00008  27bd0028  00801021 <80430000> 10600003  00000000  080a377e  24420001  03e00008
[    1.192000] ---[ end trace 9d89ccbcae27fe40 ]---
[    1.200000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    1.200000]
[    1.200000] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 44787
2015-03-15 14:19:22 +00:00
..
adm5120 adm5120: switch kernel to 3.18 2015-03-01 16:24:15 +00:00
adm8668 kernel: move CONFIG_MIPS_O32_FP64_SUPPORT to generic configs 2015-03-01 11:37:15 +00:00
ar7 ar7: register_mtd_parser() does no longer have a return value 2015-03-10 11:02:45 +00:00
ar71xx atheros: v3.18: rename ATHEROS_AR231X symbol to ATH25 2015-03-13 02:57:51 +00:00
arm64 kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
at91 kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
ath25 ath25: set myself as maintainer 2015-03-13 03:02:34 +00:00
au1000 au1000: build fails if the input layer is not selected 2015-03-10 11:03:04 +00:00
avr32 targets: base-files: diag.sh does not need to be executable 2015-02-07 19:58:58 +00:00
bcm53xx bcm53xx: support NVRAM prefixes with extra / in devpath 2015-03-14 16:35:56 +00:00
brcm47xx kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
brcm63xx brcm63xx: brcm63xxpart: fix buffer overrun in of parser 2015-03-15 14:19:22 +00:00
brcm2708 brcm2708: fix mkdosfs command line options order 2015-03-15 05:18:50 +00:00
cns3xxx kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
cns21xx kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
cobalt cobalt: framebuffer device has moved 2015-03-12 10:05:48 +00:00
ep93xx kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
gemini kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
generic kernel: fix portability issues of the x86 vdso2c utility 2015-03-15 04:43:22 +00:00
imx6 kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
iop32x kernel: disbale HAMRADIO in generic config 2015-03-06 07:56:21 +00:00
ipq806x ipq806x: add 2 missing symbols that broke a full build 2015-03-10 11:02:52 +00:00
ixp4xx kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
kirkwood kirkwood: add missing symbol that broke full builds 2015-03-10 11:03:10 +00:00
lantiq lantiq: add a better fix to strip FCS from ethernet packets on XRX200 2015-03-15 09:47:34 +00:00
malta kernel: disbale HAMRADIO in generic config 2015-03-06 07:56:21 +00:00
mcs814x kernel: disbale HAMRADIO in generic config 2015-03-06 07:56:21 +00:00
mpc52xx kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
mpc83xx kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
mpc85xx kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
mvebu mvebu: add backported patch to reenable hw i/o coherency 2015-03-06 18:57:49 +00:00
mxs kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
netlogic kernel: remove GENERIC_NET_UTILS from platform configs 2015-03-06 07:55:57 +00:00
octeon kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
omap kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
omap24xx kernel: disbale HAMRADIO in generic config 2015-03-06 07:56:21 +00:00
orion kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
oxnas kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
ppc40x kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
ppc44x ppc44x: use the mtdsplit framework for the Taishan 2015-03-11 12:20:03 +00:00
pxa kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
ramips ralink: support change tx/rx ring size 2015-03-13 08:38:08 +00:00
rb532 kernel: disbale HAMRADIO in generic config 2015-03-06 07:56:21 +00:00
realview kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
sibyte all targets: remove all =m kernel config symbols 2015-01-05 13:02:44 +00:00
sparc kernel: disbale HAMRADIO in generic config 2015-03-06 07:56:21 +00:00
sunxi kernel: move KERNFS to generic config 2015-03-06 07:56:47 +00:00
uml kernel: disbale HAMRADIO in generic config 2015-03-06 07:56:21 +00:00
x86 x86: refresh kernel config 2015-03-15 04:43:37 +00:00
x86_64 kernel: disable ARCH_NEEDS_CPU_IDLE_COUPLED 2015-03-06 07:56:34 +00:00
xburst kernel: disbale HAMRADIO in generic config 2015-03-06 07:56:21 +00:00
Makefile