Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Apr 2024 23:43:15 +0000
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   Question regarding crunchgen(1) binaries
Message-ID:  <erhqcnky6qf4adlupgtszkmrihthbdc2tbwtbhgzyltl3pl42c@gsdzinackzhh>

next in thread | raw e-mail | index | archive | help

--mz2p6heg5z522xk2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hey FreeBSD Hackers,

Note: I originally posted this to the HardenedBSD users mailing list.
I'm posting to freebsd-hackers@ to hopefully learn from a wider
audience.

I wanted to ping the HardenedBSD community, asking about the
usefulness of crunchgen(1)-built applications in 2024.

=46rom the crunchgen(1) manual page:

> The main reason to crunch programs together is for fitting as many
> programs as possible onto an installation or system recovery floppy.

The binaries in /rescue are built with crunchgen. It seems that
crunchgen-built applications are not (currently) compatible with a
libc built with LTO due to the recent CSU and libc changes.

The size of the binaries in /rescue on HardenedBSD 15-CURRENT/amd64
are 17MB in size. That application size alone makes it impossible to
build a "system recovery floppy". Additionally, floppy drives aren't
all too common on the amd64, arm64, and riscv64 systems HardenedBSD
targets.

Control Flow Integrity (CFI) is a compiler-based exploit mitigation
that we apply to applications in HardenedBSD 15-CURRENT and 14-STABLE.
In order to apply CFI to applications, application code must be built
with Link Time Optimization (LTO).

Over the past few years, I've slowly been working on applying CFI to
shared objects (aka, Cross-DSO CFI). This requires building library
code with LTO as well.

It seems that with the recent changes to the CSU and libc, the
crunchgen(1) built tool does not produce workable applications when
libc is built with LTO. With libc having such a huge surface area, it
would be prudent to apply Cross-DSO CFI to it.

This presents two possible solutions:

1. Enhance crunchgen(1) to support libc built with LTO.
2. Kick crunchgen(1) to the curb.
3. Other ideas from the community are possible.

Does anyone find crunchgen(1) to be truly useful in 2024? If we kick
crunchgen(1) to the curb, we need to modify the build system for
/rescue binaries.

My own preference would indeed to rid ourselves of crunchgen(1) so
that we can progress towards applying Cross-DSO CFI and LTO to libc.

Thanks,

--=20
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50
https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A=
4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc

--mz2p6heg5z522xk2
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmYcahMACgkQ/y5nonf4
4fqc+g/7BAKhiQUJKcZj5shig7v7qKfxn9n2IDXm7M0DeqYm6krfLqm1DcWa5E4W
ASJKmU5SlhXg8T77npF2b5Pwsbge3lTriRknakDEZg3mi7EXHSMgf2aLRuQZ6uAp
RAbJtx9jb4hlvHE0ZXiQ1aUf5ZwGkGvWFCvBc9+yJh3vWjSHEJ8Z5fK8/5MPk0Pa
+LgbtrNBaA54iVjBP8X29I6WA/uZoKMtieYYpn8q6e6vj2OuzYt5HxIPAIy2TmAw
o0Awa1kEVCrA8TQWf0hXZHqAU73lOAZK1D7MGERfk4ODFH5EykLw7vSwNLz78/Qs
aSNcYHTSPLrN+s6KA3RXAibbqLqEbNYwkrJ94jasAHxi0BY7iyI6oFdHXIABk9Ov
WNhPDZDoqFwLJ+OAySZechajEkfE8d9+riie63iDkWjSW7AOX5xu9rQqOeAVUmiR
SSXcTNQKzFjHtm6hoAxHbRoQe5S7SO0ddh43HDE+9IesLRKeyfr3zJmZk7UzA1+0
HplsuuL7nBXqxKgOkj8n8AOYmG/vJyyZPzIXJuBGDSkzeqvHfzZcc7F9c8j6JUEh
RZSYFkjoQOfqV9kfMPyL+XP7xyT8jEWgp0hcAYBtk7jOkfDUJTTDcZL0t3WQrYfH
0bEEBxwpk6ST90EdknD+CPR9fdL0iNBO7hfF5AvXA9vPsi1aGjs=
=mz3z
-----END PGP SIGNATURE-----

--mz2p6heg5z522xk2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?erhqcnky6qf4adlupgtszkmrihthbdc2tbwtbhgzyltl3pl42c>