Root cause analysis:
--------------------
Device operating mode 8(bluetooth alone), our driver supports multiple modes like 13(WiFi + Bluetooth), WiFi related structures are not been initialized in Bluetooth alone mode(8), dereferencing them in rsi_shutdown function causes crash. In Redpine
driver, this NULL check is missed. Hence, Added the fix for the same.
Fix:
----
Added proper NULL check in shutdown function.
Regression Petential:
---------------------
This is a very direct issue Since the driver is crashing reboot. We rebooted multiples times, checked the driver stability. Every thing ran smooth.
SRU Justification:
------------------
Impact:
-------
Kernel crash upon inserting shutdown or rebooting the device.
Test case:
----------
1) Power up the device, Redpine modules are loaded by default.
2) Reboot or shutdown the device.
3) Observe the behavior.
Result: 0x2c/0x100 [rsi_sdio] shutdown+ 0x2c/0x100 [rsi_sdio] 00bd78 EFLAGS: 00010246 0(0000) GS:ffffa08b70b0 0000(0000) 0000000 shutdown+ 0x14e/0x200 power_off+ 0x35/0x70 0x132/0x210 sigtimedwait+ 0x88/0xe0 0x6f/0xa0 64+0x73/ 0x130 64_after_ hwframe+ 0x3d/0xa2
-------
Redpine driver crashes the entire kernel and below is the crash log.
... skipping ...
[ 47.002030] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000038
[ 47.010828] IP: rsi_shutdown+
[ 47.016180] PGD 0 P4D 0
[ 47.019025] Oops: 0000 1 SMP PTI
[ 47.136275] CPU: 1 PID: 1 Comm: systemd-shutdow Not tainted
4.15.0-1035-oem #40-Ubuntu
[ 47.145131] Hardware name: Dell Inc. Edge Gateway 3001/0YMHCG,
BIOS 01.00.08 10/23/2018
[ 47.154096] RIP: 0010:rsi_
[ 47.160039] RSP: 0018:ffffb08d00
[ 47.165887] RAX: 0000000000000000 RBX: ffffa08b77f1d000 RCX: 0000000000000000
[ 47.173869] RDX: 0000000000000002 RSI: ffffffffc07aa77f RDI: 0000000000000001
[ 47.181851] RBP: ffffb08d0000bd90 R08: 0000000000000000 R09: ffffb08d0000bc50
[ 47.189834] R10: 0000000000000000 R11: 000000000000023a R12: ffffa08b6d940000
[ 47.197816] R13: ffffa08b3cbfb408 R14: ffffffff8f556137 R15: ffffa08b3cbfb468
[ 47.205801] FS: 00007f85cd09394
knlGS:000000000
[ 47.214854] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 47.221281] CR2: 0000000000000038 CR3: 000000006a930000 CR4: 00000000001006e0
[ 47.229262] Call Trace:
[ 47.232017] device_
[ 47.236416] kernel_
[ 47.240711] SYSC_reboot+
[ 47.244721] ? SYSC_rt_
[ 47.249604] ? do_writev+0x61/0xf0
[ 47.253411] ? do_writev+0x61/0xf0
[ 47.257219] ? sigprocmask+
[ 47.261225] SyS_reboot+0xe/0x10
[ 47.264841] do_syscall_
[ 47.268945] entry_SYSCALL_
Root cause analysis: ------- ------
-------
Device operating mode 8(bluetooth alone), our driver supports multiple modes like 13(WiFi + Bluetooth), WiFi related structures are not been initialized in Bluetooth alone mode(8), dereferencing them in rsi_shutdown function causes crash. In Redpine
driver, this NULL check is missed. Hence, Added the fix for the same.
Fix:
----
Added proper NULL check in shutdown function.
Regression Petential: ------- -------
-------
This is a very direct issue Since the driver is crashing reboot. We rebooted multiples times, checked the driver stability. Every thing ran smooth.