Act nowcan affect a running systemThe raw payload has no superseded_by markers. The two avoid windows are based on consecutive diffs that explicitly complete the preceding Win64 ABI and DNS TC=1 changes. TCachedValues is not referenced outside its declaration and implementation at this revision; its Exists defect therefore affects only new adopters.
DNS retries truncated replies and Win64 allocation respects the ABI
DNS clients now retry every truncated UDP response over TCP and reject malformed compressed names more safely; TXT and HINFO record text is decoded according to its length-prefixed wire format. FPC Win64 users receive a two-commit repair that removes stack-pointer manipulation around calls in mormot.core.fpcx64mm and replaces a lock routine that could fault under Windows ARM emulation. The new TCachedValues wrapper is not ready for use because its Exists comparison branches are reversed in this revision.
TL;DR
- DnsQuery now retries TC=1 responses over TCP even when the UDP packet has no answers or carries an error code.
- DnsParseString rejects forward, self and reserved compression pointers; TXT and HINFO fields now follow their RFC length-prefixed encoding.
- FPC Win64 mormot.core.fpcx64mm no longer uses push/pop around ABI-sensitive calls; take build 2.4.16790 rather than stopping at 2.4.16784.
- TCachedValues is newly public, but TCachedValues.Exists always misses with the default comparator and ignores a supplied CustomCompare in this revision.
Upgrade advice
FPC Win64 users of FPC_X64MM and applications depending on mormot.net.dns should land on build 2.4.16790. Do not stop on build 2.4.16784, before the remaining Win64 push/pop sites were converted, or on build 2.4.16786, before the TC=1 fallback accepted error-coded truncated packets. Do not adopt TCachedValues.Exists until its comparison selection is corrected.
9 of 9 entries · 10 commits upstream
1
High
Win64 allocator assembly moves stack preservation into FPC-managed locals
mormot.core.fpcx64mm rewrites the MSWINDOWS paths of _GetMem, _ReallocMem and _AllocMem to save non-volatile registers and temporary values in declared locals rather than push/pop around calls. mormot.core.os also removes the dedicated x86-64 TRWLock.ReadOnlyLock assembly and uses the Pascal LockedExc/SpinAndWait implementation after the assembly path was observed to GPF under Windows ARM PRISM.
Fixes
mormot.core.fpcx64mm+1
3aca6e26+109-66
core: fixed fpcx64mm on Win64 ABI
Impact
FPC Win64 code using FPC_X64MM no longer disturbs rsp across ABI-sensitive nested calls in its main allocation paths, reducing crash or corruption risk. Windows ARM systems running x86-64 code through PRISM avoid the observed TRWLock general-protection fault; other platforms retain their existing paths.
Upgrade recommended
FPC_X64MM Win64 deployments should take this together with 4af05f7 and rebuild from build 2.4.16785 or later, not stop on 2.4.16784.
2
High
The remaining Win64 allocator calls stop preserving registers with push and pop
mormot.core.fpcx64mm adds MSWINDOWS local save slots to PrefetchMediumBlock, FreeMediumBlock and _FreeMem. Their non-volatile registers, medium-block size and return value are stored in the compiler-owned frame instead of changing rsp around nested calls; the System V path keeps push/pop.
Fixes
mormot.core.fpcx64mm
4af05f7b+48-12
core: (hopefully) one last fpcx64mm pass for Win64 ABI fixes
Impact
This completes the Win64 ABI repair for allocation and free paths where stack alignment and shadow space are controlled by FPC. Services using FPC_X64MM on Win64 avoid the remaining call-site risk; POSIX/Linux assembly remains on its faster stackless path.
Upgrade recommended
Use build 2.4.16785 or later for FPC_X64MM on Win64; rebuild and stress allocation, reallocation and free workloads.
Units
3
High
Compressed DNS names reject loops, forward pointers and reserved labels
DnsParseString in mormot.net.dns calculates each 14-bit compression offset separately and rejects offsets at or beyond the pointer position or answer boundary. It records only the first return position and rejects the reserved %01xxxxxx and %10xxxxxx label forms before copying bytes.
Fixes
mormot.net.dns
ddb63463+15-10
net: fixed DnsParseString() decoding against RFC 1035
Impact
Malformed or hostile DNS answers can no longer keep the parser following a self or forward compression chain indefinitely, and out-of-range pointers fail before access. Valid RFC 1035 backward compression continues to decode.
Upgrade recommended
Upgrade services that parse DNS answers from external resolvers and include malformed compression-pointer cases in protocol tests.
Public API
DnsParseStringbehaviour-changed — Invalid forward, self, reserved and out-of-range compression encodings now return zero.
Units
4
High
An empty truncated UDP reply now still triggers a DNS TCP retry
DnsQuery in mormot.net.dns accepts a UDP response as soon as its header, source, transaction ID and response flag are valid, then inspects Truncation before requiring a body larger than the request or a non-zero AnswerCount. A TC=1 header therefore switches to the existing TCP path even with no answers.
Fixes
mormot.net.dns
7c79f344+12-9
net: fixed DNS responses with TC=1
Impact
Resolvers such as current Samba versions that return only a truncated header over UDP no longer cause a false DNS failure. The client follows RFC 2181 and obtains the complete answer through TCP.
Upgrade recommended
Upgrade mormot.net.dns users affected by missing answers from Samba or other resolvers, and land on build 2.4.16790 to include the follow-up TC checks.
Units
5
Medium
TXT and HINFO records now decode their character-string fields
mormot.net.dns adds the bounded DnsParseCharString helper. DnsParseData concatenates all length-prefixed strings in a TXT RDATA field, decodes exactly two HINFO strings as CPU and OS, and clears Text when a component exceeds the record boundary. The other touched units only correct spelling in comments or an LDAP error string.
Fixes
mormot.core.text+2
55352bf1+51-7
net: properly decode TXT/HINFO DNS fields content
Impact
TXT answers no longer expose their wire length bytes as text or treat the field as a compressed domain name. HINFO returns the intended CPU and OS pair, and malformed lengths fail without reading into the next record.
Upgrade recommended
Upgrade code that consumes TXT or HINFO through DnsParseData, then verify any parser downstream that previously compensated for the incorrect text.
Public API
DnsParseDatabehaviour-changed — TXT and HINFO RDATA now use DNS character-string decoding.
6
Medium
DNS header flags and TCP fallback accept valid server behavior
TDnsHeader.GetZ now reads Flags2, where the Z bits reside. DnsQuery checks TC before rejecting a non-success response code, so any truncated UDP reply may trigger TCP, and it no longer requires RecursionAvailable on the final TCP response.
Fixes
mormot.net.dns
f2d633a0+7-8
net: some other fixes to our DNS parser
Impact
Authoritative or non-recursive DNS servers can answer over TCP without setting RA, and truncated error-coded UDP packets still receive the mandatory TCP retry. Header Z inspection now reports the correct byte.
Upgrade recommended
Take at least build 2.4.16787 for TC=1 handling, preferably the edition head with the subsequent parser fixes.
Units
7
Medium
The new thread-safe value cache cannot find entries correctly yet
mormot.core.unicode adds the public TCachedValues record/object with TLightLock protection, a sorted TRawUtf8DynArray, time-window reset through GetTickSec shr TixShr, and Reset, Exists and Add methods. In Exists, the Assigned(CustomCompare) branch calls the default comparison overload, while the nil branch passes nil to the custom-comparison overload.
New features
mormot.core.unicode
047555ca+64-2
core: new TCachedValues thread-safe wrapper
Impact
With the default nil CustomCompare, TCachedValues.Exists calls an overload that immediately returns not found because no comparator is assigned. With a custom comparator, Add sorts with it but Exists searches with the default case-sensitive comparator. New callers therefore cannot rely on Exists in build 2.4.16790.
Worth a look
Do not adopt TCachedValues.Exists at this revision; wait for a correction or locally reverse its comparator branches and add tests for default and custom comparisons.
Public API
TCachedValuesadded — Public time-windowed, sorted RawUtf8 cache with Reset, Exists and Add; Exists is defective in this revision.
Units
8
Low
Network regression files stay beside the test executable
TNetworkProtocols.Setup creates an executable-local temp directory and the OpenAPI, Kerberos keytab, DHCP lease and HTTP body-download tests use it instead of the system temporary folder or WorkDir. A sequence suffix also prevents body-download filenames from colliding.
Tests
73b7ed6a+57-27
tests: network protocols won't use system temp folder
Impact
Test runs avoid system-temp permissions and no longer let background tests observe each other’s transient files in WorkDir. Framework runtime and application file locations are unchanged.
9
Low
PDF font tests accept known output hashes from more Windows setups
TTestUiPdf.FontEmbeddingAndHashValidation replaces two OS-version hash tables with five accepted hashes selected by IntegerScanExists. It also uses an explicit TPdfDocument variable, reports the font name with a hexadecimal hash, and keeps the second pass only when ANSI_CHARSET replacement is available.
Tests
5ee01b27+28-29
test: refined TTestUiPdf.FontEmbeddingAndHashValidation
Impact
PDF regression tests tolerate known font-embedding differences that are driven by installed system fonts rather than a framework defect. PDF generation code and application output are not changed.