Commit d4c0226 ("[dns] Support DNS search lists") introduced a regression when handling CNAME records resolving to names longer than the original name. The "end of name" offset stored in dns->offset was not updated to reflect the length of the new name, causing dns_question() to append the (empty) search suffix at an incorrect offset within the name buffer, resulting in a mangled DNS name. In the case of a CNAME record resolving to a name shorter than or equal in length to the original name, then the mangling would occur in an unused portion of the name buffer. In the common case of a name server returning the A (or AAAA) record along with the CNAME record, this would cause name resolution to succeed despite the mangling. (If the name server did not return the A or AAAA record along with the CNAME record, then the mangling would be revealed by the subsequent invalid query packet.) Reported-by: Nicolas Sylvain <nsylvain@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
550 |
|
550 |
|
551 |
|
551 |
|
552 |
|
552 |
|
|
553 |
|
|
|
554 |
|
|
|
555 |
|
|
553 |
|
556 |
|
554 |
|
557 |
|
555 |
|
558 |
|
|
|
||
614 |
|
617 |
|
615 |
|
618 |
|
616 |
|
619 |
|
|
620 |
|
|
617 |
|
621 |
|
618 |
|
622 |
|
619 |
|
623 |
|
|
|
||
691 |
|
695 |
|
692 |
|
696 |
|
693 |
|
697 |
|
694 |
|
|
|
|
698 |
|
|
|
699 |
|
|
|
700 |
|
|
|
701 |
|
|
695 |
|
702 |
|
|
703 |
|
|
696 |
|
704 |
|
697 |
|
705 |
|
698 |
|
706 |
|
|
|
||
745 |
|
753 |
|
746 |
|
754 |
|
747 |
|
755 |
|
748 |
|
|
|
|
756 |
|
|
|
757 |
|
|
|
758 |
|
|
749 |
|
759 |
|
750 |
|
760 |
|
751 |
|
761 |
|