Hello,
I’m trying to modify the linux kernel for the RSB3730 board. For now, I am starting with a “stock” kernel, on which I made NO MODIFICATIONS.
I am starting from branch adv_5.4.70_2.3.0_rm02 , and compiling with the main defconfig imx_v8_adv_defconfig.
The kernel builds just fine and an Image and dtb are made. However, I get the following kernel panic:
[ 4.317297] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: adv_wdt_i2c_probe+0x254/0x340
[ 4.327866] CPU: 1 PID: 33 Comm: kworker/1:1 Not tainted 5.4.70 #2
[ 4.334057] Hardware name: Advantech RISC Single Board (DT)
[ 4.339698] Workqueue: events deferred_probe_work_func
[ 4.344858] Call trace:
[ 4.347334] dump_backtrace+0x0/0x150
[ 4.351020] show_stack+0x14/0x20
[ 4.354365] dump_stack+0xb4/0x11c
[ 4.357793] panic+0x158/0x334
[ 4.360854] __stack_chk_fail+0x1c/0x20
[ 4.364700] adv_wdt_i2c_probe+0x254/0x340
[ 4.368825] i2c_device_probe+0x284/0x310
[ 4.372847] really_probe+0xdc/0x420
[ 4.376430] driver_probe_device+0x54/0xf0
[ 4.380531] __device_attach_driver+0xa4/0x100
[ 4.385006] bus_for_each_drv+0x74/0xd0
[ 4.388849] __device_attach+0xc4/0x170
[ 4.392700] device_initial_probe+0x10/0x20
[ 4.396888] bus_probe_device+0x90/0xa0
[ 4.400744] device_add+0x318/0x660
[ 4.404246] device_register+0x1c/0x30
[ 4.408005] i2c_new_client_device+0x14c/0x2b0
[ 4.412461] i2c_new_device+0xc/0x20
[ 4.416063] of_i2c_register_devices+0xf4/0x188
[ 4.420601] i2c_register_adapter+0x14c/0x3f0
[ 4.424968] __i2c_add_numbered_adapter+0x58/0xa0
[ 4.429684] i2c_add_adapter+0x9c/0xd0
[ 4.433444] i2c_add_numbered_adapter+0x24/0x30
[ 4.437991] i2c_imx_probe+0x378/0x880
[ 4.441757] platform_drv_probe+0x50/0xb0
[ 4.445780] really_probe+0xdc/0x420
[ 4.449362] driver_probe_device+0x54/0xf0
[ 4.453472] __device_attach_driver+0xa4/0x100
[ 4.457922] bus_for_each_drv+0x74/0xd0
[ 4.461771] __device_attach+0xc4/0x170
[ 4.465619] device_initial_probe+0x10/0x20
[ 4.469813] bus_probe_device+0x90/0xa0
[ 4.473654] deferred_probe_work_func+0x64/0xa0
[ 4.478217] process_one_work+0x1c0/0x350
[ 4.482233] worker_thread+0x200/0x450
[ 4.486006] kthread+0x148/0x150
[ 4.489261] ret_from_fork+0x10/0x24
[ 4.492890] SMP: stopping secondary CPUs
[ 4.497491] Kernel Offset: disabled
[ 4.501000] CPU features: 0x0002,2000200c
[ 4.505022] Memory Limit: none
[ 4.508123] ---[ end Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: adv_wdt_i2c_probe+0x254/0x340 ]---
Using gdb, I can see that the instruction pointer mentioned in the panic can be found at drivers/watchdog/watchdog_advantech.c:496:
ret = adv_wdt_i2c_read_version(client, &tmp_version);
if (ret == 0 )
{
adv_wdt.version[0]= (tmp_version & 0xFF00) >> 8; // HERE it panics
adv_wdt.version[1]= tmp_version & 0xFF;
adv_wdt_info.firmware_version = (unsigned int)(adv_wdt.version[1] - '0') * 10 + (unsigned int)(adv_wdt.version[0] - '0');
} else {
pr_err("Read watchdog version err=%d\n", ret);
goto fail;
}
Am I doing something wrong? I haven’t touched neither the source code, nor the configuration file.
Thank you,
Rick