google / gwpsan

GWPSan: Sampling-Based Sanitizer Framework
Apache License 2.0
307 stars 9 forks source link

core/semantic_metadata: Fix logging message #23

Closed copybara-service[bot] closed 4 months ago

copybara-service[bot] commented 4 months ago

core/semantic_metadata: Fix logging message

__sanitizer_metadata_covered_del() uses ConsumeRelativePC() to compute a PC contained in the module. ConsumeRelativePC() takes the current entry as an inout param, however, we use the same variable later for logging:

auto [mod, _] = FindFunc(ConsumeRelativePC(start, end, version), false);
...
SAN_LOG("unloaded covered metadata from %p-%p", start, end);

Because start is advanced, this would print a subtly different address range than intended.

Fix it by copying start.