kasan: bring up kasan
authortao zeng <tao.zeng@amlogic.com>
Thu, 30 Aug 2018 06:17:02 +0000 (14:17 +0800)
committertao zeng <tao.zeng@amlogic.com>
Fri, 31 Aug 2018 05:55:18 +0000 (13:55 +0800)
commita977bfe1658877d2d5d2152e7e826b5ec16f6c7c
tree8b4c88545f27ab7a81e02632d7fac27b8b2b2c92
parent97000aa433948731db2a3e5aea13cde12110eacb
kasan: bring up kasan

PD#172700:

1. Fix boot fail due to vmap exit problem after enable kasan;
2. Fix make fail problem when open stack/static size check
   after enable kasan;
3. fix dt-match problems reported by kasan:

==================================================================
BUG: KASAN: global-out-of-bounds in __of_match_node+0x78/0xc0
Read of size 1 at addr ffffff900a5696d0 by task swapper/0/1

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.113 #5
Hardware name: Amlogic (DT)
Call trace:
[<ffffff900908ecc0>] dump_backtrace+0x0/0x368
[<ffffff900908f0cc>] show_stack+0x24/0x30
[<ffffff900963bdb0>] dump_stack+0xa0/0xc8
[<ffffff90092ba21c>] print_address_description+0x144/0x258
[<ffffff90092ba694>] kasan_report+0x264/0x338
[<ffffff90092b897c>] __asan_load1+0x4c/0x58
[<ffffff9009ab99c0>] __of_match_node+0x78/0xc0
[<ffffff9009ab9a48>] of_match_node+0x40/0x68
[<ffffff9009abcac8>] of_match_device+0x38/0x50
[<ffffff90097631c4>] platform_match+0x7c/0x128
[<ffffff900975fcdc>] __device_attach_driver+0x64/0x140
[<ffffff900975c8b4>] bus_for_each_drv+0xec/0x158
[<ffffff900975f694>] __device_attach+0x164/0x1c8
[<ffffff900975fe4c>] device_initial_probe+0x24/0x30
[<ffffff900975e3a8>] bus_probe_device+0xe8/0xf8
[<ffffff900975aae8>] device_add+0x548/0x880
[<ffffff9009abd21c>] of_device_add+0x64/0x90
[<ffffff9009abdbd8>] of_platform_device_create_pdata+0xc0/0x128
[<ffffff9009abde4c>] of_platform_bus_create+0x1c4/0x488
[<ffffff9009abe274>] of_platform_populate+0x74/0xd0
[<ffffff900abfeaa0>] of_platform_default_populate_init+0x78/0x88
[<ffffff900908421c>] do_one_initcall+0xac/0x1f8
[<ffffff900abb10bc>] kernel_init_freeable+0x254/0x2f4
[<ffffff900a290b40>] kernel_init+0x18/0x118
[<ffffff9009083e80>] ret_from_fork+0x10/0x50

The buggy address belongs to the variable:
meson_gxl_pinctrl_dt_match+0x190/0x840

Memory state around the buggy address:
ffffff900a569580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffff900a569600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffff900a569680: 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa
^
ffffff900a569700: 00 04 fa fa fa fa fa fa 00 06 fa fa fa fa fa fa
ffffff900a569780: 03 fa fa fa fa fa fa fa 05 fa fa fa fa fa fa fa
==================================================================

Change-Id: I8b0a6369fbdc10ba5106bf4f40d4b82971b7ad23
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
arch/arm64/mm/mmu.c
drivers/amlogic/Makefile
drivers/amlogic/cec/hdmi_ao_cec.c
drivers/amlogic/ddr_tool/ddr_bandwidth.c
drivers/amlogic/media/video_processor/ionvideo/ionvideo.c
drivers/amlogic/memory_ext/page_trace.c
drivers/amlogic/pinctrl/pinctrl-meson-gxl.c
drivers/amlogic/pinctrl/pinctrl-meson-txl.c
drivers/amlogic/pinctrl/pinctrl-meson-txlx.c
drivers/amlogic/pinctrl/pinctrl-meson8b.c
drivers/amlogic/pm/gx_pm.c