Page MenuHomeFreeBSD

Prepare some build fixes in advance of more _FORTIFY_SOURCE
ClosedPublic

Authored by kevans on Jun 21 2024, 4:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 25, 3:53 PM
Unknown Object (File)
Tue, Dec 24, 5:17 PM
Unknown Object (File)
Mon, Dec 23, 5:01 AM
Unknown Object (File)
Wed, Dec 18, 5:12 PM
Unknown Object (File)
Fri, Dec 13, 5:46 AM
Unknown Object (File)
Nov 29 2024, 7:06 AM
Unknown Object (File)
Nov 24 2024, 8:15 AM
Unknown Object (File)
Nov 23 2024, 9:48 AM

Details

Summary

ZFS' libspl needs to be made aware that we have strlcat(3) and
strlcpy(3) to avoid some more complicated declaration duplication, so
go ahead and define these HAVE_ macros now.

While we're here, make sure that we disable _FORTIFY_SOURCE in the
bootloader because we don't have the symbol renaming support today to do
it as cleanly as we'd like. ssp/ssp.h needs to be pulled into the libsa
environment so that other bits can understand that ssp is disabled in
the consistent __SSP_FORTIFY_LEVEL way that we try to do.

Sponsored by: Stormshield
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

allanjude added a subscriber: allanjude.

ZFS bits look good to me

This revision is now accepted and ready to land.Jun 21 2024, 5:04 PM
include/ssp/ssp.h
39 ↗(On Diff #140077)

Why is this needed? I'd assume that this file is never included in kernel builds since it lives under include/.

include/ssp/ssp.h
39 ↗(On Diff #140077)

Ah, I forgot to revisit this. Thinking about it, this was probably an artifact of an incorrect conditional in one of the kernel headers that have some fortified bits in them. I think they all look fine now, so this likely just goes away.

kevans marked an inline comment as done.

Push exclusion of _KERNEL out of ssp/ssp.h, we just shouldn't see
_FORTIFY_SOURCE > 0 there ever. Fix the problem in libprocstat instead, which
includes the following verbiage added to the commit message:

libprocstat has to define `_KERNEL` and include kernel headers in order
to get what it wants, but this results in sys/cdefs.h being included too
late and we pick up the build breaking version of the __RENAME
definition.  Just explicitly include sys/cdefs.h earlier rather than
disabling _FORTIFY_SOURCE.  The zfs/ subdir only builds an object that
holds some structures and sizes, so just disable _FORTIFY_SOURCE there
entirely rather than trying to move #define _KERNEL into the file..
This revision now requires review to proceed.Jun 26 2024, 5:41 PM
This revision is now accepted and ready to land.Jul 2 2024, 2:07 PM