ospfd: validate extended prefix TLV before accessing prefix SID - #22215
Conversation
Ensure the extended-prefix TLV contains enough data before accessing a prefix-SID sub-tlv. Signed-off-by: Mark Stapp <mjs@cisco.com> Reported-by: luzhixiang <lzx0xf1@gmail.com>
|
@Mergifyio backport stable/10.6 stable/10.5 |
β Backports have been createdDetails
|
Greptile SummaryAdds a defensive length check in
Confidence Score: 5/5Safe to merge; the change is a minimal, targeted guard that prevents a heap over-read on malformed LSAs without altering any well-formed code path. The arithmetic in the new check is correct: the TLV body must be at least 20 bytes to safely reach every field accessed via the pref_sid pointer. All existing checks pass before this new one, and the function's return-on-failure pattern is consistent with the rest of the function. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "ospfd: validate extended prefix TLV befo..." | Re-trigger Greptile |
ospfd: validate extended prefix TLV before accessing prefix SID (backport #22215)
ospfd: validate extended prefix TLV before accessing prefix SID (backport #22215)
Ensure the extended-prefix TLV contains enough data before accessing a prefix-SID sub-tlv.