mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
drm/amd/ras: add first record offset check
check the upper and lower limits of first record offset Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
3999aa4a04
commit
df749c115f
|
|
@ -1163,6 +1163,13 @@ static int __check_ras_table_status(struct ras_core_context *ras_core)
|
|||
}
|
||||
|
||||
control->ras_fri = RAS_OFFSET_TO_INDEX(control, hdr->first_rec_offset);
|
||||
if (hdr->first_rec_offset < control->ras_record_offset ||
|
||||
control->ras_fri >= control->ras_max_record_count) {
|
||||
RAS_DEV_ERR(ras_core->dev,
|
||||
"RAS header invalid, ras_fri: %u, first_rec_offset:0x%x",
|
||||
control->ras_fri, hdr->first_rec_offset);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user