This is a mostly-unmodified copy of the various *_chk implementations
and headers from NetBSD, without yet modifying system headers to start
actually including them. A future commit will also apply the needed
bits to fix ssp/unistd.h.
Details
- Reviewers
imp pauamma_gundo.com kib - Group Reviewers
manpages
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 41976 Build 38864: arc lint + arc unit
Event Timeline
include/ssp/string.h | ||
---|---|---|
100 | This is always true... | |
include/ssp/unistd.h | ||
40 | why redirect read(2) and none of the other system calls that write back into user space? I don't see any others in NetBSD's either. Expanding it is a big ask, so before I really do that as more than maybe a suggestion, I'd like to know the thinking here. |
include/ssp/string.h | ||
---|---|---|
100 | Fair point; I'll hack it back out in the second patch that reworks part of these headers for FreeBSD (with a brief explanation that it's tautological here) | |
include/ssp/unistd.h | ||
40 | I think they more or less tried to stick with the common _FORTIFY_SOURCE implementation (glibc). We can expand it, but IMO let's get to the baseline and define expanding it as future work (explicitly in the commit message) -- the baseline should be 'relatively safe' as folks have been running with glibc's implementation for years as it is. |
Since this code goes directly into our libc source, and not into vendor import area, should it follow style(9)? The most systematic thing I noted is return a; instead of return (a); Another thing is the headers inclusion order.
include/ssp/ssp.h | ||
---|---|---|
38 | I do not think lint is relevant for FreeBSD. | |
lib/libc/secure/sprintf_chk.c | ||
47 | These lint-style comments (as well LINTLIBRARY) are not relevant either. |
include/ssp/unistd.h | ||
---|---|---|
40 | The counter you your argument may also be that fortify_source was done years ago and is showing its age :).... |
Straighten out some style and other bits:
- clang || GCC >= 4.8 is a given
- Remove irrelevant LINT/lint bits
- Shuffle around includes in *_chk.c, alphabetical order with ssp/* headers last
- Remove spurious prototypes in *_chk.c; these should be provided in ssp/*
- return x => return (x)
lib/libssp/Versions.def | ||
---|---|---|
3 | Is this true? |
lib/libssp/Versions.def | ||
---|---|---|
3 | I added the comment based on the greatest of technicalities, that it appeared in our version of libssp in 13.0-CURRENT (since I added our version of libssp in cd0d51baaa4509a1d); happy enough to revise it, though. |
lib/libssp/Versions.def | ||
---|---|---|
3 | Ok it's fine with me 👍 |
lib/libssp/ssp.3 | ||
---|---|---|
121 | Would be good if you could also mention FreeBSD here. |
- Fix word order
- "in" before .Nx
- Mention FreeBSD (had GNU version, this version came in in 12.2, enhancements to be in... 14.0)
I think this is fine, modulo notes about its completeness, but I'm OK with that and it's not bad.
I'm updating the other reviews to address pending comments; I'd like to land this initial batch that matches what NetBSD has, then I'll start going through other existing headers and see what else we can add.