<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ports/Mk/Features/fortify.mk, branch main</title>
<subtitle>FreeBSD ports tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/ports/'/>
<entry>
<title>Mk/Features: Add features for fortify, zeroregs and stack autoinit.</title>
<updated>2025-05-24T18:21:13+00:00</updated>
<author>
<name>Alexander Leidinger</name>
<email>netchild@FreeBSD.org</email>
</author>
<published>2025-05-24T18:17:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/ports/commit/?id=7a489e95c51f47f5e25a5613e375ec000618e52a'/>
<id>7a489e95c51f47f5e25a5613e375ec000618e52a</id>
<content type='text'>
Those 3 features for ports go along with the cooresponding features from
the basesystem (some only availabe in -current).

The options you can put into make.conf for the ports collections are:

WITH_FORTIFY=yes
    This enables mitigations of common memory safety issues, such as buffer
    overflows, by adding checks to functions like memcpy, strcpy, sprintf,
    and others when the compiler can determine the size of the destination
    buffer at compile time.

WITH_STACK_AUTOINIT=yes
    This enables a compiler specific option to automatically initialize
    local (automatic) variables to prevent the use of uninitialized memory.

WITH_ZEROREGS=yes
    Zero call-used registers at function return to increase program
    security by either mitigating Return-Oriented Programming (ROP)
    attacks or preventing information leakage through registers.
    This depends upon support from the compiler for a given architecture.
    This is disabled for python ports, currently there are issues.

Approved by:	portmgr (mat)
PR:		284270
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Those 3 features for ports go along with the cooresponding features from
the basesystem (some only availabe in -current).

The options you can put into make.conf for the ports collections are:

WITH_FORTIFY=yes
    This enables mitigations of common memory safety issues, such as buffer
    overflows, by adding checks to functions like memcpy, strcpy, sprintf,
    and others when the compiler can determine the size of the destination
    buffer at compile time.

WITH_STACK_AUTOINIT=yes
    This enables a compiler specific option to automatically initialize
    local (automatic) variables to prevent the use of uninitialized memory.

WITH_ZEROREGS=yes
    Zero call-used registers at function return to increase program
    security by either mitigating Return-Oriented Programming (ROP)
    attacks or preventing information leakage through registers.
    This depends upon support from the compiler for a given architecture.
    This is disabled for python ports, currently there are issues.

Approved by:	portmgr (mat)
PR:		284270
</pre>
</div>
</content>
</entry>
</feed>
