While we’re waiting for CVE-2016-5195
to be patched, RedHat released a workaround for the most common form of the
exploit being run in the wild. It uses systemtap
to block access to mem_write
function.
I wanted to apply it and started tests, only to find that stap
returned EPERM
while loading the module! As I’m
running with SELinux enabled, I checked the /var/log/audit/audit.log
. Surprisingly there was no AVCs with deny!
Although most of the calls are audited, you can mark some to be silently dropped by audit. You can disable that filter
using semanage dontaudit off
. I run stap
again and… bingo!
|
|
Apparently SELinux is blocking loading of the module. I checked the comments on the RedHat KB article and no one else was hit by that problem. I tested in on another vm and it worked fine. Something wasn’t right, but I had a clue!
The affected system runs with confined users and I run the stap
within staff_u:sysadm_r:sysadm_t:s0-s0:c0.c1023
context. On the system it worked fine, I run the command in unconfined domain. Suspecting a bug in SELinux policy, I
generated the policy module:
|
|
and loaded it with semodule -i local_stap.pp
.
I rerun stap
command with workaround and this time it worked as expected!
Don’t forget to disable auditing everything as it can easly fill out /var/log: semanage dontaudit on
.