]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amd/ras: validate RAS EEPROM tbl_size before record count
authorCandice Li <candice.li@amd.com>
Tue, 19 May 2026 09:31:21 +0000 (17:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Jun 2026 17:52:55 +0000 (13:52 -0400)
commite5565e7c3fada97f8b95c9704df80db85feafea4
tree31bbfbee7440a305bdfb3555d49cdfe713e55fb7
parenta4b0c3f5d2287997876d8f711a40d3c0418458d8
drm/amd/ras: validate RAS EEPROM tbl_size before record count

Corrupt EEPROM data can set tbl_size below the table header size.
Guard the RAS_NUM_RECS macros against undersized tbl_size and reset
the table during init when tbl_size is below the minimum for the table
version instead of trusting the header.

Signed-off-by: Candice Li <candice.li@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c