[not4n00bs] ...A Better "libc"

Post tutorials, HOWTO's and other useful resources here.
Post Reply
User avatar
n0ctilucient
Samurai
Samurai
Posts: 140
Joined: 21 Apr 2017, 15:59
Distribution: fullmoonremix
Location: 127.0.0.1
Contact:

[not4n00bs] ...A Better "libc"

Post#1 by n0ctilucient » 14 Nov 2017, 23:37

It's no secret I favor Musl over glibc because like
Google's Bionic it is immune to browser exploits
like Return-to-libc attack and Stack buffer overflow

see... https://security.googleblog.com/2016/02 ... k.html?m=1

Although... I addressed this issue in an earlier,
thread (as "fullmoonremix") I have since found,
another way to enable musl libc as a glibc drop-in.

Renaming /usr/lib64/musl/ld-musl-x86_64.so.1
to ldd and copying it to /user/bin to overwrite the
original ldd is the initial way to deprecate glibc.

However... ld-musl-x86_64.so.1 is actually
a symlink to /usr/lib64/musl/libc.so.1

That means you can send libc.so.1 to a /root/Desktop
symlink rename it ldd and then copy it to /usr/bin to
overwrite the original ldd.

Please Note: One should always make remastered
module changes in /root/Desktop to avoid breaking
module symlinks.

It's been a while since I've reached out to src2pkg's
creator but since musl libc breaks src2pkg's "setup"
perhaps he knows a workaround.

Or maybe the solution lies in /usr/bin/musl-gcc?

More to come...
Last edited by n0ctilucient on 30 Nov 2017, 19:23, edited 1 time in total.
:hmmm: I do NOT have the "right" to tell anyone what they should do...
but I reserve the "right" to tell them what they should consider.

User avatar
n0ctilucient
Samurai
Samurai
Posts: 140
Joined: 21 Apr 2017, 15:59
Distribution: fullmoonremix
Location: 127.0.0.1
Contact:

[not4n00bs] ...A Better "libc"

Post#2 by n0ctilucient » 19 Nov 2017, 16:53

Ok... reached out to Gilbert (src2pkg).
The following is his solution...
export CC /usr/bin/musl-gcc ; src2pkg --setup
Last edited by n0ctilucient on 30 Nov 2017, 19:16, edited 2 times in total.
:hmmm: I do NOT have the "right" to tell anyone what they should do...
but I reserve the "right" to tell them what they should consider.

User avatar
n0ctilucient
Samurai
Samurai
Posts: 140
Joined: 21 Apr 2017, 15:59
Distribution: fullmoonremix
Location: 127.0.0.1
Contact:

[not4n00bs] ...A Better "libc"

Post#3 by n0ctilucient » 30 Nov 2017, 01:31

Updated my post.. An alternate script is to follow.

I also need to ask if this solution can be
added to /etc/src2pkg/src2pkg.conf... :%)
see... Src2pkg.conf w/ "hardened" EXTRA_FLAGS

If everything works out... there is a pathway to
a "hardened" musl libc build of ALL binaries...

Hardened Gentoo and Alpine Linux use this strategy.
:hmmm: I do NOT have the "right" to tell anyone what they should do...
but I reserve the "right" to tell them what they should consider.

Post Reply