CVE: CVE-2023-52817
Published: 2024-05-21
Description: In the Linux kernel, the following vulnerability has been resolved:

drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL

In certain types of chips, such as VEGA20, reading the amdgpu_regs_smc file could result in an abnormal null pointer access when the smc_rreg pointer is NULL. Below are the steps to reproduce this issue and the corresponding exception log:

1. Navigate to the directory: /sys/kernel/debug/dri/0
2. Execute command: cat amdgpu_regs_smc
3. Exception Log::
[4[PII_REDACTED]54] BUG: kernel NULL pointer dereference, address: [PII_REDACTED]
[4[PII_REDACTED]62] #PF: supervisor instruction fetch in kernel mode
[4[PII_REDACTED]67] #PF: error_code(0x0010) - not-present page
[4[PII_REDACTED]70] PGD 0 P4D 0
[4[PII_REDACTED]76] Oops: 0010 [#1] SMP NOPTI
[4[PII_REDACTED]81] CPU: 4 PID: 62563 Comm: cat Tainted: G           OE     5.15.0-43-generic #46-Ubunt       u
[4[PII_REDACTED]90] RIP: 0010:0x0
[4[PII_REDACTED]98] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
[4[PII_REDACTED]00] RSP: 0018:ffffa82b46d27da0 EFLAGS: 00010206
[4[PII_REDACTED]05] RAX: [PII_REDACTED] RBX: [PII_REDACTED] RCX: ffffa82b46d27e68
[4[PII_REDACTED]09] RDX: [PII_REDACTED] RSI: [PII_REDACTED] RDI: ffff9940656e0000
[4[PII_REDACTED]12] RBP: ffffa82b46d27dd8 R08: [PII_REDACTED] R09: ffff994060c07980
[4[PII_REDACTED]15] R10: [PII_REDACTED] R11: [PII_REDACTED] R12: 00007f5e06753000
[4[PII_REDACTED]18] R13: ffff9940656e0000 R14: ffffa82b46d27e68 R15: 00007f5e06753000
[4[PII_REDACTED]22] FS:  00007f5e0755b740(0000) GS:ffff99479d300000(0000) knlGS:[PII_REDACTED]
[4[PII_REDACTED]26] CS:  0010 DS: 0000 ES: 0000 CR0: [PII_REDACTED]
[4[PII_REDACTED]29] CR2: ffffffffffffffd6 CR3:[PII_REDACTED]3fc000 CR4:[PII_REDACTED]3506e0
[4[PII_REDACTED]33] Call Trace:
[4[PII_REDACTED]36]  <TASK>
[4[PII_REDACTED]40]  amdgpu_debugfs_regs_smc_read+0xb0/0x120 [amdgpu]
[4[PII_REDACTED]02]  full_proxy_read+0x5c/0x80
[4[PII_REDACTED]11]  vfs_read+0x9f/0x1a0
[4[PII_REDACTED]19]  ksys_read+0x67/0xe0
[4[PII_REDACTED]23]  __x64_sys_read+0x19/0x20
[4[PII_REDACTED]28]  do_syscall_64+0x5c/0xc0
[4[PII_REDACTED]34]  ? do_user_addr_fault+0x1e3/0x670
[4[PII_REDACTED]40]  ? exit_to_user_mode_prepare+0x37/0xb0
[4[PII_REDACTED]47]  ? irqentry_exit_to_user_mode+0x9/0x20
[4[PII_REDACTED]52]  ? irqentry_exit+0x19/0x30
[4[PII_REDACTED]57]  ? exc_page_fault+0x89/0x160
[4[PII_REDACTED]62]  ? asm_exc_page_fault+0x8/0x30
[4[PII_REDACTED]68]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[4[PII_REDACTED]75] RIP: 0033:0x7f5e07672992
[4[PII_REDACTED]79] Code: c0 e9 b2 fe ff ff 50 48 8d 3d fa b2 0c 00 e8 c5 1d 02 00 0f 1f 44 00 00 f3 0f        1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 e       c 28 48 89 54 24
[4[PII_REDACTED]83] RSP: 002b:00007ffe03097898 EFLAGS: 00000246 ORIG_RAX: [PII_REDACTED]
[4[PII_REDACTED]88] RAX: ffffffffffffffda RBX: [PII_REDACTED] RCX: 00007f5e07672992
[4[PII_REDACTED]91] RDX: [PII_REDACTED] RSI: 00007f5e06753000 RDI: [PII_REDACTED]
[4[PII_REDACTED]94] RBP: 00007f5e06753000 R08: 00007f5e06752010 R09: 00007f5e06752010
[4[PII_REDACTED]96] R10: [PII_REDACTED] R11: [PII_REDACTED] R12: [PII_REDACTED]
[4[PII_REDACTED]99] R13: [PII_REDACTED] R14: [PII_REDACTED] R15: [PII_REDACTED]
[4[PII_REDACTED]05]  </TASK>
[4[PII_REDACTED]07] Modules linked in: nf_tables libcrc32c nfnetlink algif_hash af_alg binfmt_misc nls_       iso8859_1 ipmi_ssif ast intel_rapl_msr intel_rapl_common drm_vram_helper drm_ttm_helper amd64_edac t       tm edac_mce_amd kvm_amd ccp mac_hid k10temp kvm acpi_ipmi ipmi_si rapl sch_fq_codel ipmi_devintf ipm       i_msghandler msr parport_pc ppdev lp parport mtd pstore_blk efi_pstore ramoops pstore_zone reed_solo       mon ip_tables x_tables autofs4 ib_uverbs ib_core amdgpu(OE) amddrm_ttm_helper(OE) amdttm(OE) iommu_v       2 amd_sched(OE) amdkcl(OE) drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec rc_core        drm igb ahci xhci_pci libahci i2c_piix4 i2c_algo_bit xhci_pci_renesas dca
[4[PII_REDACTED]84] CR2: [PII_REDACTED]
[4[PII_REDACTED]88] ---[ en
---truncated---
CVSS Score: 5.5 (MEDIUM)
CWE: CWE-476, CWE-476
References: https://git.kernel.org/stable/c/174f62a0aa15c211e60208b41ee9e7cdfb73d455; https://git.kernel.org/stable/c/437e0fa907ba39b4d7eda863c03ea9cf48bd93a9; https://git.kernel.org/stable/c/5104fdf50d326db2c1a994f8b35dcd46e63ae4ad