Debarshi Dutta
9328f057a7
gpu: nvgpu: fix use-after-free use case of CE APP.
The following issue is reported when running sudo modprobe -r nvgpu
[ 134.066392] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000058
[ 134.066428] Mem abort info:
[ 134.066431] ESR = 0x96000004
[ 134.066434] EC = 0x25: DABT (current EL), IL = 32 bit
[ 134.066450] [0000000000000058] pgd=0000000000000000, p4d=0000000000000000
[ 134.066459] Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP
[ 134.066639] pc : nvgpu_cic_rm_wait_for_stall_interrupts+0x78/0xd0 [nvgpu]
[ 134.066847] lr : nvgpu_cic_rm_wait_for_stall_interrupts+0x74/0xd0 [nvgpu]
[ 134.067043] sp : ffff80001971ba80
[ 134.067046] x29: ffff80001971ba80 x28: ffff000093b0da00
[ 134.067054] x27: 0000000000000000 x26: ffff80001c28b990
[ 134.067061] x25: ffff00008cd01000 x24: 0000000000000bb8
[ 134.067067] x23: 0000000000000000 x22: ffff0000915b0000
[ 134.067073] x21: ffff000093b0da00 x20: ffff0000915b0000
[ 134.067079] x19: ffff0000915b0000 x18: 0000000000000036
[ 134.067085] x17: 0000000000000000 x16: 0000000000000000
[ 134.067091] x15: ffff8000126b5fd8 x14: 7373616c633d4d45
[ 134.067097] x13: ffff8000098abef0 x12: 0000000000000000
[ 134.067102] x11: ffff8000098ab5a0 x10: ffff8000098abef8
[ 134.067108] x9 : ffff80001010e844 x8 : ffff80001971ba48
[ 134.067115] x7 : 2222222222222222 x6 : ffff000093b0da00
[ 134.067122] x5 : ffff8000098b1fd8 x4 : 0000000000000000
[ 134.067127] x3 : 0000000000000000 x2 : 0000000000000000
[ 134.067133] x1 : 0000000000000000 x0 : 0000000000000000
[ 134.067138] Call trace:
[ 134.067140] nvgpu_cic_rm_wait_for_stall_interrupts+0x78/0xd0 [nvgpu]
[ 134.067328] nvgpu_cic_rm_wait_for_deferred_interrupts+0x20/0xb0 [nvgpu]
[ 134.067517] nvgpu_channel_deferred_reset_engines+0x29c/0x920 [nvgpu]
[ 134.067714] nvgpu_channel_close+0x18/0x20 [nvgpu]
[ 134.067904] nvgpu_init_pramin+0x2ac/0x350 [nvgpu]
[ 134.068092] nvgpu_ce_app_destroy+0x94/0xe0 [nvgpu]
[ 134.068279] nvgpu_put+0x90/0x120 [nvgpu]
[ 134.068465] nvgpu_pci_shutdown+0x29c/0x18a0 [nvgpu]
[ 134.068655] pci_device_remove+0x44/0xe0
[ 134.068665] device_release_driver_internal+0x114/0x1f0
[ 134.068701] driver_detach+0x54/0xe0
[ 134.068709] bus_remove_driver+0x70/0x120
[ 134.068733] driver_unregister+0x34/0x60
The above issue occurs due to freeing of CIC resources earlier than
dependent users of interrupts e.g. CDE, CE etc.
As a solution, move CIC deinit sequence to end of nvgpu_put.
This handles deinit properly for VGPU/IGPU/DGPU.
Bug 200763510
Change-Id: I696e31d5e03a9468cccfe710048000dbf7cf0269
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2592063
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-09-16 21:45:43 -07:00
..
2021-07-02 09:57:56 -07:00
2021-07-15 10:06:42 -07:00
2021-07-19 18:06:28 -07:00
2020-12-15 14:10:29 -06:00
2020-12-15 14:10:29 -06:00
2020-12-15 14:10:29 -06:00
2020-12-15 14:10:29 -06:00
2020-12-15 14:10:29 -06:00
2021-09-02 11:42:08 -07:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:48 -06:00
2020-12-15 14:13:28 -06:00
2018-06-15 17:47:31 -07:00
2021-09-02 11:42:08 -07:00
2019-01-31 12:04:10 -08:00
2018-06-15 17:47:31 -07:00
2018-06-15 17:47:31 -07:00
2020-12-15 14:05:52 -06:00
2018-06-27 07:30:06 -07:00
2018-06-15 17:47:31 -07:00
2018-06-15 17:47:31 -07:00
2020-12-15 14:10:29 -06:00
2019-04-19 13:55:11 -07:00
2020-12-15 14:13:28 -06:00
2018-09-05 04:51:40 -07:00
2020-12-15 14:13:28 -06:00
2019-07-26 04:07:01 -07:00
2020-12-15 14:13:28 -06:00
2019-06-11 09:46:24 -07:00
2021-01-20 21:56:33 -08:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2018-06-15 17:47:31 -07:00
2021-09-10 16:02:43 -07:00
2021-09-10 16:02:43 -07:00
2018-06-15 17:47:31 -07:00
2018-06-15 17:47:31 -07:00
2018-10-31 15:25:23 -07:00
2018-06-15 17:47:31 -07:00
2020-12-15 14:05:52 -06:00
2018-07-24 16:10:58 -07:00
2019-01-10 20:09:38 -08:00
2018-09-05 04:51:50 -07:00
2020-12-15 14:05:52 -06:00
2018-06-15 17:47:31 -07:00
2020-12-15 14:13:28 -06:00
2019-02-11 20:55:07 -08:00
2020-12-15 14:13:28 -06:00
2018-06-15 17:47:31 -07:00
2021-08-28 06:56:24 -07:00
2019-06-13 23:05:43 -07:00
2020-12-15 14:13:28 -06:00
2019-02-01 09:45:57 -08:00
2018-10-31 15:25:23 -07:00
2018-06-15 17:47:31 -07:00
2021-09-10 16:02:43 -07:00
2021-09-02 11:42:08 -07:00
2021-09-02 11:42:08 -07:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2021-09-08 06:50:49 -07:00
2020-12-15 14:13:28 -06:00
2018-06-15 17:47:31 -07:00
2021-08-11 01:55:08 -07:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2019-02-20 23:05:04 -08:00
2020-12-15 14:13:28 -06:00
2021-05-10 02:53:39 -07:00
2021-04-19 19:45:24 -07:00
2021-06-28 22:39:06 -07:00
2018-06-15 17:47:31 -07:00
2021-05-18 18:18:25 -07:00
2020-12-15 14:13:28 -06:00
2021-09-01 09:50:11 -07:00
2021-09-02 11:42:13 -07:00
2018-10-29 08:04:25 -07:00
2021-09-15 09:16:06 -07:00
2020-12-15 14:13:28 -06:00
2021-06-27 05:02:53 -07:00
2021-06-27 05:02:58 -07:00
2021-09-13 20:57:09 -07:00
2020-12-15 14:13:48 -06:00
2021-09-15 09:15:49 -07:00
2021-06-15 04:57:57 -07:00
2021-05-10 10:08:13 -07:00
2021-05-10 10:08:13 -07:00
2021-06-22 14:10:22 -07:00
2020-12-15 14:13:28 -06:00
2021-04-19 19:45:24 -07:00
2021-04-28 11:19:19 -07:00
2021-04-19 19:45:24 -07:00
2018-06-15 17:47:31 -07:00
2021-09-16 21:45:43 -07:00
2021-08-23 05:27:50 -07:00
2020-12-15 14:13:28 -06:00
2021-06-28 18:09:14 -07:00
2020-12-15 14:13:48 -06:00
2020-12-15 14:13:48 -06:00
2020-12-15 14:13:48 -06:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2018-07-26 00:06:07 -07:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:48 -06:00
2021-09-10 16:02:43 -07:00
2019-04-22 05:25:48 -07:00
2018-08-29 20:34:34 -07:00
2018-09-09 17:22:24 -07:00
2018-08-29 20:34:34 -07:00
2018-09-09 17:22:24 -07:00
2018-09-09 17:22:24 -07:00
2019-07-26 04:07:01 -07:00
2018-09-05 04:51:36 -07:00
2019-07-26 04:07:01 -07:00
2018-11-08 19:35:09 -08:00
2020-12-15 14:13:28 -06:00
2018-08-29 20:34:34 -07:00
2019-05-15 22:29:40 -07:00
2020-12-15 14:13:28 -06:00
2018-10-12 17:35:10 +05:30
2021-09-16 21:45:43 -07:00
2020-12-15 14:13:28 -06:00
2021-08-27 20:45:58 -07:00
2021-09-02 15:43:07 -07:00
2018-06-15 17:47:31 -07:00
2021-09-08 06:50:38 -07:00
2021-07-15 10:06:42 -07:00
2021-06-08 21:54:23 -07:00
2021-03-18 15:29:06 -07:00
2021-09-15 09:15:49 -07:00
2021-04-21 10:15:20 -07:00
2018-06-15 17:47:31 -07:00
2021-08-12 18:16:01 -07:00
2018-06-15 17:47:31 -07:00
2021-05-25 14:30:30 -07:00
2020-12-15 14:13:28 -06:00
2021-04-28 19:15:31 -07:00
2021-04-28 19:15:31 -07:00
2021-09-07 10:28:58 -07:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2019-05-06 02:56:53 -07:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2020-12-15 14:13:28 -06:00
2021-09-14 16:14:33 -07:00
2018-06-15 17:47:31 -07:00
2020-12-15 14:10:29 -06:00
2020-12-15 14:13:28 -06:00
2021-09-02 11:42:08 -07:00
2021-06-22 14:10:22 -07:00
2019-08-28 14:24:19 -07:00