1

II. Problem Description

Some of the Sanitizers cannot work correctly when ASLR is enabled. Therefore, at the initialization of such Sanitizers, ASLR is detected via procctl(2). If ASLR is enabled, it is first disabled, and then the main executable containing the Sanitizer is re-executed, after printing an appropriate message.

However, the Sanitizers work by intercepting various function calls, and by mistake the already-intercepted procctl(2) function was used. This causes an internal error, which usually results in a segfault.

III. Impact

Binaries linked to AddressSanitizer (using -fsanitize=address), MemorySanitizer (using -fsanitize=memory) or ThreadSanitizer (using -fsanitize=thread) can crash at startup with a segfault, if ASLR is enabled. Other binaries are not affected.

IV. Workaround

If ASLR is enabled system-wide, the problem can be worked around by running the specific binary with proccontrol(1), to temporarily disable ASLR for only that program. For example:

proccontrol -m aslr -s disable /path/to/example_program

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here
this post was submitted on 04 Dec 2023
1 points (100.0% liked)

FreeBSD

3 readers
1 users here now

Community focused on using FreeBSD.

Rules:

founded 1 year ago
MODERATORS