Page MenuHomeFreeBSD

sys: protect the kernel build from accidental _FORTIFY_SOURCE
ClosedPublic

Authored by kevans on Apr 11 2025, 3:33 AM.
Tags
None
Referenced Files
F142159422: D49774.id153560.diff
Fri, Jan 16, 2:44 PM
Unknown Object (File)
Thu, Jan 15, 4:49 PM
Unknown Object (File)
Tue, Jan 6, 1:42 PM
Unknown Object (File)
Fri, Dec 19, 2:31 AM
Unknown Object (File)
Dec 6 2025, 4:49 AM
Unknown Object (File)
Nov 25 2025, 6:52 AM
Unknown Object (File)
Nov 11 2025, 9:47 AM
Unknown Object (File)
Nov 11 2025, 2:00 AM

Details

Summary

Fortification is a userland feature, thus the flag makes no sense in a
kernel context at the moment. Move the relevant includes that aren't
already in a !_KERNEL block under a !_KERNEL condition to avoid breaking
kernel/kmod builds that are catching a stray -D_FORTIFY_SOURCE in their
CFLAGS.

PR: 286010

Diff Detail

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

Event Timeline

markj added inline comments.
sys/sys/poll.h
112 ↗(On Diff #153493)

We're already in a ifndef _KERNEL block here.

This revision is now accepted and ready to land.Apr 11 2025, 1:33 PM
sys/sys/poll.h
112 ↗(On Diff #153493)

Whoops, missed that; will remove, thanks.

imp added inline comments.
sys/sys/poll.h
112 ↗(On Diff #153493)

my approval is conditional on dropping this one change.