[not4n00bs] ...A Better "libc"

Post tutorials, HOWTO's and other useful resources here.
Post Reply
User avatar
n0ctilucient
Samurai
Samurai
Posts: 176
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

see also... 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 (if possible) 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 16 Feb 2018, 20:39, edited 4 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: 176
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: 176
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 build of ALL binaries...

Hardened Gentoo and Alpine Linux use this strategy.
Last edited by n0ctilucient on 16 Feb 2018, 20:37, 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: 176
Joined: 21 Apr 2017, 15:59
Distribution: fullmoonremix
Location: 127.0.0.1
Contact:

[not4n00bs] ...A Better "libc"

Post#4 by n0ctilucient » 26 Jan 2018, 16:44

Update... very busy doing a rebuild.
But I do intend to reach out to Gilbert again.

Unfortunately... the situation
is... Musl still breaks src2pkg.

I am considering... Embedded GLIBC
as a possible workaround.
Last edited by n0ctilucient on 16 Feb 2018, 20:36, 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: 176
Joined: 21 Apr 2017, 15:59
Distribution: fullmoonremix
Location: 127.0.0.1
Contact:

[not4n00bs] ...A Better "libc"

Post#5 by n0ctilucient » 16 Feb 2018, 11:53

I can boot my system with Musl :celebrate3: but I CANNOT compile on it with src2pkg :wall: (@ least in my initial testing).

More to follow...
Last edited by n0ctilucient on 16 Feb 2018, 20:31, edited 3 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: 176
Joined: 21 Apr 2017, 15:59
Distribution: fullmoonremix
Location: 127.0.0.1
Contact:

[not4n00bs] ...A Better "libc"

Post#6 by n0ctilucient » 16 Feb 2018, 12:22

Update... trying to get Musl to play nice with Tiny C Compiler .
: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