Closed PauloMigAlmeida closed 1 year ago
4106 typedef struct _ATOM_FAKE_EDID_PATCH_RECORD 4107 { 4108 UCHAR ucRecordType; 4109 UCHAR ucFakeEDIDLength; // = 128 means EDID length is 128 bytes, otherwise the EDID length = ucFakeEDIDLength*128 4110 UCHAR ucFakeEDIDString[1]; // This actually has ucFakeEdidLength elements. 4111 } ATOM_FAKE_EDID_PATCH_RECORD;
Audit (at least) all these places where the flex arrays are being used:
if (edid) { memcpy((u8 *)edid, (u8 *)&fake_edid_record->ucFakeEDIDString[0], fake_edid_record->ucFakeEDIDLength); if (drm_edid_is_valid(edid)) { rdev->mode_info.bios_hardcoded_edid = edid; rdev->mode_info.bios_hardcoded_edid_size = edid_size; } else kfree(edid); }
Patch sent https://lore.kernel.org/lkml/Y1tkWdwPUp+UdpM0@mail.google.com/T/#u
V2: https://lore.kernel.org/lkml/Y1yCRHgx15ZOiCL4@mail.google.com/
Merged
Audit (at least) all these places where the flex arrays are being used: