Rodrigo Siqueira
1e68b7ce6b
drm/amd/display: Fix NULL pointer dereference for DTN log in DCN401
...
[ Upstream commit 5af757124792817f8eb1bd0c80ad60fab519586b ]
When users run the command:
cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log
The following NULL pointer dereference happens:
[ +0.000003] BUG: kernel NULL pointer dereference, address: NULL
[ +0.000005] #PF: supervisor instruction fetch in kernel mode
[ +0.000002] #PF: error_code(0x0010) - not-present page
[ +0.000002] PGD 0 P4D 0
[ +0.000004] Oops: 0010 [#1 ] PREEMPT SMP NOPTI
[ +0.000003] RIP: 0010:0x0
[ +0.000008] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[...]
[ +0.000002] PKRU: 55555554
[ +0.000002] Call Trace:
[ +0.000002] <TASK>
[ +0.000003] ? show_regs+0x65/0x70
[ +0.000006] ? __die+0x24/0x70
[ +0.000004] ? page_fault_oops+0x160/0x470
[ +0.000006] ? do_user_addr_fault+0x2b5/0x690
[ +0.000003] ? prb_read_valid+0x1c/0x30
[ +0.000005] ? exc_page_fault+0x8c/0x1a0
[ +0.000005] ? asm_exc_page_fault+0x27/0x30
[ +0.000012] dcn10_log_color_state+0xf9/0x510 [amdgpu]
[ +0.000306] ? srso_alias_return_thunk+0x5/0xfbef5
[ +0.000003] ? vsnprintf+0x2fb/0x600
[ +0.000009] dcn10_log_hw_state+0xfd0/0xfe0 [amdgpu]
[ +0.000218] ? __mod_memcg_lruvec_state+0xe8/0x170
[ +0.000008] ? srso_alias_return_thunk+0x5/0xfbef5
[ +0.000002] ? debug_smp_processor_id+0x17/0x20
[ +0.000003] ? srso_alias_return_thunk+0x5/0xfbef5
[ +0.000002] ? srso_alias_return_thunk+0x5/0xfbef5
[ +0.000002] ? set_ptes.isra.0+0x2b/0x90
[ +0.000004] ? srso_alias_return_thunk+0x5/0xfbef5
[ +0.000002] ? _raw_spin_unlock+0x19/0x40
[ +0.000004] ? srso_alias_return_thunk+0x5/0xfbef5
[ +0.000002] ? do_anonymous_page+0x337/0x700
[ +0.000004] dtn_log_read+0x82/0x120 [amdgpu]
[ +0.000207] full_proxy_read+0x66/0x90
[ +0.000007] vfs_read+0xb0/0x340
[ +0.000005] ? __count_memcg_events+0x79/0xe0
[ +0.000002] ? srso_alias_return_thunk+0x5/0xfbef5
[ +0.000003] ? count_memcg_events.constprop.0+0x1e/0x40
[ +0.000003] ? handle_mm_fault+0xb2/0x370
[ +0.000003] ksys_read+0x6b/0xf0
[ +0.000004] __x64_sys_read+0x19/0x20
[ +0.000003] do_syscall_64+0x60/0x130
[ +0.000004] entry_SYSCALL_64_after_hwframe+0x6e/0x76
[ +0.000003] RIP: 0033:0x7fdf32f147e2
[...]
This error happens when the color log tries to read the gamut remap
information from DCN401 which is not initialized in the dcn401_dpp_funcs
which leads to a null pointer dereference. This commit addresses this
issue by adding a proper guard to access the gamut_remap callback in
case the specific ASIC did not implement this function.
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-14 15:34:15 +02:00
..
2024-05-19 09:21:03 -07:00
2024-05-24 08:43:25 -07:00
2024-08-14 15:34:08 +02:00
2024-08-03 09:00:44 +02:00
2024-08-03 09:00:34 +02:00
2024-08-03 09:01:04 +02:00
2024-08-14 15:34:05 +02:00
2024-08-03 09:01:08 +02:00
2024-08-14 15:34:12 +02:00
2024-08-03 09:00:54 +02:00
2024-05-15 12:59:55 -06:00
2024-08-03 09:00:43 +02:00
2024-08-03 09:00:47 +02:00
2024-08-14 15:34:07 +02:00
2024-06-22 13:48:11 +09:00
2024-08-14 15:34:07 +02:00
2024-05-16 08:50:32 -07:00
2024-08-03 09:00:55 +02:00
2024-06-25 14:45:27 -07:00
2024-05-19 09:21:03 -07:00
2024-08-03 09:00:59 +02:00
2024-05-28 22:21:34 +02:00
2024-08-03 08:59:09 +02:00
2024-06-15 14:59:26 +09:00
2024-08-03 09:00:45 +02:00
2024-05-22 12:26:46 -07:00
2024-08-14 15:34:05 +02:00
2024-08-14 15:34:15 +02:00
2024-08-11 12:57:57 +02:00
2024-06-06 06:03:29 +00:00
2024-08-14 15:34:05 +02:00
2024-08-03 09:00:09 +02:00
2024-07-13 10:50:55 +02:00
2024-08-03 09:01:08 +02:00
2024-08-03 09:00:08 +02:00
2024-08-03 09:00:55 +02:00
2024-08-03 09:00:13 +02:00
2024-08-03 09:00:11 +02:00
2024-08-03 09:01:07 +02:00
2024-08-14 15:34:00 +02:00
2024-08-03 09:01:04 +02:00
2024-08-03 09:00:39 +02:00
2024-08-03 09:00:17 +02:00
2024-08-03 09:00:28 +02:00
2024-08-14 15:34:06 +02:00
2024-08-14 15:34:15 +02:00
2024-08-03 08:59:20 +02:00
2024-05-14 18:25:53 -07:00
2024-08-03 09:00:03 +02:00
2024-08-03 09:00:14 +02:00
2024-07-11 17:48:54 +02:00
2024-08-03 09:00:47 +02:00
2024-08-14 15:34:11 +02:00
2024-05-29 13:08:31 +01:00
2024-05-23 12:04:36 -07:00
2024-08-14 15:34:07 +02:00
2024-08-03 09:00:15 +02:00
2024-07-08 15:42:20 -06:00
2024-08-03 08:59:20 +02:00
2024-08-03 09:00:45 +02:00
2024-08-11 12:57:59 +02:00
2024-08-11 12:57:56 +02:00
2024-08-03 09:00:59 +02:00
2024-08-03 09:00:24 +02:00
2024-08-14 15:34:05 +02:00
2024-07-09 12:47:46 +02:00
2024-05-28 21:53:51 +02:00
2024-08-14 15:34:02 +02:00
2024-06-18 13:26:44 -07:00
2024-08-03 08:59:14 +02:00
2024-05-14 23:36:19 +09:00
2024-06-16 11:22:57 +02:00
2024-06-12 21:30:43 +01:00
2024-08-03 09:00:56 +02:00
2024-06-21 13:49:25 +02:00
2024-05-23 12:04:36 -07:00
2024-08-03 09:00:54 +02:00
2024-08-03 09:00:26 +02:00
2024-08-03 09:00:58 +02:00
2024-08-14 15:34:08 +02:00
2024-06-03 17:35:24 +05:30
2024-08-03 09:01:06 +02:00
2024-06-27 15:47:30 +02:00
2024-05-21 13:11:44 -07:00
2024-06-27 17:10:38 +02:00
2024-08-14 15:34:08 +02:00
2024-05-31 13:13:39 +03:00
2024-07-04 12:30:30 +02:00
2024-08-03 09:00:07 +02:00
2024-08-03 09:00:44 +02:00
2024-05-22 08:32:48 -04:00
2024-07-10 08:47:46 -06:00
2024-08-03 09:00:15 +02:00
2024-08-03 09:00:43 +02:00
2024-05-19 09:21:03 -07:00
2024-05-23 12:04:36 -07:00
2024-08-03 09:01:00 +02:00
2024-08-14 15:34:08 +02:00