Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clk: rockchip: pvtm : fix up the of_match_table cross-border access
fix up the error log: [ 2.901537] ================================================================== [ 2.901625] BUG: KASAN: global-out-of-bounds in __of_match_node.part.0+0x30/0xa0 [ 2.901655] Read of size 1 at addr ffffff900934ae08 by task swapper/0/1 [ 2.901693] [ 2.901727] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.20 khadas#11 [ 2.901766] Hardware name: Rockchip RK3399 Evaluation Board v3 (Android) (DT) [ 2.901817] Call trace: [ 2.901863] dump_backtrace+0x0/0x250 [ 2.901909] show_stack+0x14/0x1c [ 2.901942] dump_stack+0xf8/0x170 [ 2.901998] print_address_description+0x54/0x238 [ 2.902049] kasan_report+0x294/0x2bc [ 2.902099] __asan_load1+0x24/0x50 [ 2.902154] __of_match_node.part.0+0x30/0xa0 [ 2.902188] of_match_node+0x38/0x5c [ 2.902240] of_match_device+0x48/0x4c [ 2.902294] platform_match+0x60/0xe8 [ 2.902341] __driver_attach+0x40/0x10c [ 2.902392] bus_for_each_dev+0x10c/0x134 [ 2.902424] driver_attach+0x30/0x3c [ 2.902454] bus_add_driver+0x238/0x28c [ 2.902503] driver_register+0x140/0x188 [ 2.902559] __platform_driver_register+0x7c/0x88 [ 2.902619] rockchip_clock_pvtm_driver_init+0x18/0x20 [ 2.902666] do_one_initcall+0x14c/0x47c [ 2.902702] kernel_init_freeable+0x5ec/0x60c [ 2.902752] kernel_init+0x10/0x110 [ 2.902801] ret_from_fork+0x10/0x18 [ 2.902841] [ 2.902863] The buggy address belongs to the variable: [ 2.902925] rockchip_clock_pvtm_match+0xc8/0x2e0 [ 2.902944] [ 2.902991] Memory state around the buggy address: [ 2.903028] ffffff900934ad00: 00 00 00 07 fa fa fa fa 00 00 00 00 00 00 00 00 [ 2.903073] ffffff900934ad80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 2.903126] >ffffff900934ae00: 00 fa fa fa fa fa fa fa 00 02 fa fa fa fa fa fa [ 2.903167] ^ [ 2.903197] ffffff900934ae80: 00 05 fa fa fa fa fa fa 00 00 00 00 03 fa fa fa [ 2.903230] ffffff900934af00: fa fa fa fa 00 00 03 fa fa fa fa fa 00 00 00 06 [ 2.903266] ================================================================== Change-Id: Ie2bc926da76dfbb14ca6e250d7fe57e842939f79 Signed-off-by: Elaine Zhang <[email protected]>
- Loading branch information