unistd fortify macros broken

Peter S. Mazinger ps.m at gmx.net
Thu May 11 21:25:35 UTC 2006


On Wed, 10 May 2006, Nitin Gupta wrote:

> When adding -D_FORTIFY_SOURCE=2, the uclibc unistd.h file includes
> bits/unistd.h, which apparently doesn't exist.
> 
> The problem code in unistd.h is here:
> /* Define some macros helping to catch buffer overflows.  */
> #if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
> # include <bits/unistd.h>
> #endif
> 
> One suggestion is there should be a warning in its place if the macros don't actually
> do anything.

If that part of code is in, it does not mean that it will be supported (it 
would need duplicating many of functions that would make uClibc 
much bigger). 
Normally those parts when they are synced from glibc should either be left 
out or should be changed to #if 0 /*earlier used part*/
If you need such functionality, then you should look into libsafe and add 
the "secured" versions for all the functions you want to replace.

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list