Intel compiler runtime: __intel_alloc_bpv() causes SIGSEGV when SELinux denies executable heap memory allocation

Summary

We have identified a reproducible segmentation fault in an Intel Fortran-compiled scientific application (VASP 6.6.1) running on an AlmaLinux 8 and 9 system with SELinux enabled in enforcing mode.

Our investigation indicates that the failure originates in the Intel compiler runtime function __intel_alloc_bpv(), which attempts to assign executable permissions to heap-allocated memory. When this operation is denied by SELinux, the resulting allocation failure appears not to be handled correctly.

Environment

  • Application: VASP 6.6.1

  • Application build date: 2026-11-27

  • Operating system: AlmaLinux 8.10

  • Architecture: x86_64

  • Processor: Intel Xeon E7-4850 v4 @ 2.10 GHz

  • CPU family: 6

  • CPU model: 79

  • CPU stepping: 1

  • CPU instruction support: AVX, AVX2, FMA, BMI1, BMI2

  • Intel oneMKL: 2026.2

  • Intel Fortran compiler version: 2026.2.1

  • SELinux status: Enforcing

Observed behavior

VASP completes its initial self-consistent calculation but terminates with a segmentation fault during a finite-difference phonon calculation (IBRION=6).

The issue is reproducible with a single MPI rank.

Initially, the failure appeared to be related to AVX2 instruction dispatch, as the calculation succeeds when setting:

MKL_ENABLE_INSTRUCTIONS=AVX

However, subsequent debugging indicates that the failure is related to executable memory allocation rather than unsupported CPU instructions.

Technical investigation

GDB analysis identified the Intel compiler runtime function __intel_alloc_bpv() as being involved in the failure.

The function appears to allocate approximately 2 MiB of memory using posix_memalign() and subsequently attempts to assign read, write, and execute permissions to the allocated memory.

The failing execution produces the following system call:

mprotect(0x107a5000, 2097424,
         PROT_READ|PROT_WRITE|PROT_EXEC)
    = -1 EACCES (Permission denied)

SELinux denies the operation because the allocated memory resides on the process heap, and executable heap memory is prohibited by the active security policy.

Following this failure, a NULL pointer appears to be returned and subsequently dereferenced.

The segmentation fault occurs within:

finite_differences_mp_finite_diff_id_
MAIN__
main

The register contents at the failing instruction indicate a NULL pointer dereference rather than an illegal instruction.

When the allocation is instead served by a separate memory mapping permitted by the active SELinux policy, the corresponding system call succeeds:

mprotect(0x7f1a00d35000, 2097424,
         PROT_READ|PROT_WRITE|PROT_EXEC)
    = 0

We have also performed further tests using the latest version Intel Fortran compiler and have confirmed it to occur with

ifx version 2026.2.1

The issue can be observed on Alma 8 (REDHAT_SUPPORT_PRODUCT_VERSION=“8.10”) and Alma 9 (REDHAT_SUPPORT_PRODUCT_VERSION=“9.9”). However, it does not occur on Fedora 45.

Reproducibility

We have asked Claude to write a small two-file Fortran program that can reliably reproduce this issue. It contains a module subroutine, an internal procedure reading one of its stack locals, and an external callee reached through an implicit interface.

vasp-selinux-reproducer.zip (12.3 KB)
**
vasp-selinux-reproducer.zip:** trampoline_repro.f90 (main program and host module) and tramp_callee.f90 (the external callees, which must stay a separate file). The two MKL elimination tests are included for context.

Build on a Linux host with glibc. -static-intel is there so nm can see the runtime symbol, as it does in vasp_std:

ifx -O2 -g -traceback -I"${MKLROOT}/include" \
tramp_callee.f90 trampoline_repro.f90 -o tramp3 -static-intel \
-Wl,--start-group ${MKLROOT}/lib/libmkl_intel_lp64.a \
${MKLROOT}/lib/libmkl_sequential.a ${MKLROOT}/lib/libmkl_core.a \
-Wl,--end-group -lpthread -lm -ldl

Confirm the compiler emitted a trampoline pool, then run the four cases:

nm tramp3 | grep -i bpv # expect __intel_alloc_bpv

./tramp3 none # passes
./tramp3 bump # SIGSEGV
./tramp3 mallopt # passes
MALLOC_MMAP_THRESHOLD_=131072 ./tramp3 bump # passes

Only bump should crash. Each run prints the glibc version, the SELinux state, and a probe reporting where a 2 MiB request was served from and whether mprotect(RWX) was allowed; the probe uses no Intel runtime, so it isolates the SELinux half of the chain on its own.

Workaround

For the moment, we have identified the following workaround. Setting the environmental variable
MALLOC_MMAP_THRESHOLD_=131072 disables the problematic dynamical memory allocation.
We also noticed that a limitation of Intel MKL to use AVX had an unindented consequence of circumventing this issue. However, only the MALLOC variable setting can be seen as a valid workaround.

Request

Would it be possible to investigate the implementation of __intel_alloc_bpv() and clarify:

  • Whether this behavior is a known runtime defect.

  • Whether the runtime can avoid requesting executable permissions for ordinary heap allocations.

  • Whether a supported workaround exists that does not require relaxing SELinux security policies or modifying the dynamical memory allocation.

Upon request, we can provide additional information.