| 1 |
# SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 |
|
| 3 |
[Match] |
| 4 |
Environment=SANITIZERS |
| 5 |
Environment=!SANITIZERS= |
| 6 |
|
| 7 |
[Build] |
| 8 |
# Set verify_asan_link_order=0 to prevent ASAN warnings when building the image and make sure the real ASAN |
| 9 |
# options are set when booting the image. |
| 10 |
# Set intercept_tls_get_addr=0 to work around leak sanitizer segmentation fault in test-dlopen-so on CentOS |
| 11 |
# Stream 9. |
| 12 |
# TODO: Drop intercept_tls_get_addr=0 when we remove CentOS Stream 9 builds. |
| 13 |
Environment=ASAN_OPTIONS=verify_asan_link_order=0:intercept_tls_get_addr=0 |
| 14 |
|
| 15 |
[Content] |
| 16 |
# When modifying these also modify mkosi.extra/usr/lib/systemd/system.conf.d/10-sanitizers.conf. We don't use |
| 17 |
# systemd.setenv here as there's a size limit on the kernel command line and we don't want to trigger it. We |
| 18 |
# don't use ManagerEnvironment= either as we want these to be set for pid1 from the earliest possible moment. |
| 19 |
KernelCommandLine= |
| 20 |
ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_invalid_pointer_pairs=2:handle_ioctl=1:print_cmdline=1:disable_coredump=0:use_madv_dontdump=1 |
| 21 |
UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 |
| 22 |
LSAN_OPTIONS=suppressions=/usr/lib/systemd/leak-sanitizer-suppressions |