GrapheneOS / hardened_malloc

Hardened allocator designed for modern systems. It has integration into Android's Bionic libc and can be used externally with musl and glibc as a dynamic library for use on other Linux-based platforms. It will gain more portability / integration over time.
https://grapheneos.org/
MIT License
1.26k stars 96 forks source link

[Question/Linux] Exclude programs from golbal setting in ld.so.preload. #152

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi there,

this is not a technical but a usability question.

[sapiens@computer ~]$ cat /etc/ld.so.preload 
/usr/lib/libhardened_malloc.so

As you can see I have made hardened_malloc the global default. I am however now facing a problem that certain programs crash when using it, one reproduceable example is Handbrake.

Is there a way to set hardened_malloc as a global default while exclude certain programs from using it? I was unable to find a answer to this question anywhere.

Thanks in advance and have a great day everyone!

ghost commented 2 years ago

You should use a container or namespace without hardened_malloc in the container/namespace to make exceptions.

thestinger commented 2 years ago

I don't really see a reasonable way for hardened_malloc to offer anything for this.

thestinger commented 2 years ago

You can use mount namespaces to replace that file or you could use the LD_PRELOAD approach but it's really meant to be used globally.