Memory allocation on the stack and LD_PRELOAD segment


Hello,

I am writing a Linux module (based on the GitHub project called "Ccontrol") to create caching (for example, coloring pages) to mitigate the attacks of the temporary channel (to prevent attacks like Prime + Probe).

I used the LD_PRELOADsystem env variable to overwrite all calls malloc(), calloc()and free()and replace them with colored calls.

Now I am looking to color the stack and data segments.

What is a system call / library to allocate memory for a new birth process?
Is there a way to overwrite this call (without recompiling the kernel) using LD_PRELOADor any other method?

Thanks everyone in advance,
Gal

+4
source share
1 answer

There are two allocated memory for system calls: sbrkone that extends the (continuous) heap segment and mmapone that is used to map individual segments of anonymous memory to the address space of the calling process.

LD_PRELOAD, . , , , , DSO-libc, , (DSO-internal ( __attribute__((visibility("hidden")))), libc. , .

, ptrace .

+1

Source: https://habr.com/ru/post/1679324/


All Articles