Commit d6956ef
Map file with MAP_SHARED instead of MAP_PRIVATE
When setting up a user probe using ebpf or systemtap on a file,
fapolicyd computes a different checksum, causing (usually) denial to
occur.
eBPF is used by Microsoft's MDATP, in particular for monitoring
/usr/lib64/libpam.so.0 function calls. Through setting a user probe,
mdatp and fapolicyd cannot be used concurrently.
The reason for computing a different checksum is using mmap(MAP_PRIVATE)
which makes the hooks set by ebpf and/or systemtap be visible:
~~~
1140 char *get_hash_from_fd2(int fd, size_t size, file_hash_alg_t alg)
1141 {
:
1165 mapped = mmap(0, size, PROT_READ, MAP_PRIVATE|MAP_POPULATE, fd, 0);
1166 if (mapped != MAP_FAILED) {
:
~~~
A solution consists in using MAP_SHARED instead of MAP_PRIVATE.
Fixes RHEL-142628.1 parent ee5ab7e commit d6956ef
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
1165 | | - | |
| 1165 | + | |
1166 | 1166 | | |
1167 | 1167 | | |
1168 | 1168 | | |
| |||
0 commit comments