Re: [PATCH v2] perf test amd ibs: avoid using executable heap
Namhyung Kim <[email protected]>
| Newsgroups | org.kernel.vger.selinux,org.kernel.vger.linux-kernel,org.kernel.vger.linux-perf-users |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 01 Jul 2026 08:23:21 +0200, Ondrej Mosnacek wrote: > Making [parts of] the heap executable is dangerous and is blocked by > SELinux on Fedora/RHEL even for an unconfined user. Replace the malloc() > + mprotect() combo with just mmap(), creating a private anonymous rwx > mapping, which only requires the more commonly allowed "execmem" > permission under SELinux (things like JIT or regex compilation need it > as well). mmap() with MAP_ANONYMOUS will give us a zeroed mapping that > begins on a page boundary, so the result is equivalent to the original > code even without a memset() or the page-alignment dance. > > [...] Applied to perf-tools-next, thanks! Best regards, Namhyung