Commit Graph

19185 Commits

Author SHA1 Message Date
wiz
4e9665c6ea Sort SEE ALSO. 2018-08-13 06:08:48 +00:00
wiz
c9911a308e Various improvements.
More markup, sort errors, fix -1.
2018-08-13 06:00:21 +00:00
christos
491e774596 switch to the new bind. 2018-08-12 13:01:55 +00:00
ryo
fae343b8b2 fix multiple definition of __{ge,lt,gt,le,eq,ne,unordt}tf2 in libc and libgcc.
this fixes the ATF call_once_static, call_once2_static, cxxruntime_static, static_destructor_static.
2018-08-11 10:06:40 +00:00
kamil
c85fcdfeed Merge FreeBSD improvements to the man-page of timespec_get(3)
Keep NetBSD references instead of FreeBSD ones included in the FreeBSD
version.
2018-08-10 20:35:52 +00:00
simonb
e6a7f880ff Avoid curx going beyond end of window when adding a wide character to the
last column.

OK @blymn.
2018-08-08 02:26:08 +00:00
ryo
e6a0182575 need to set _UC_TLSBASE of uc_flags for _lwp_makecontext().
pointed out from skrll@. thanks.
2018-08-04 10:22:09 +00:00
kamil
93bf963a4b Restrict -fno-sanitize=function to Clang/LLVM only
The base GCC version 6,x does not support this option.
2018-08-03 14:01:21 +00:00
kamil
d92938e14a Add a support to build ubsan.c in libc
Under the condition of MKLIBCSANITIZER==yes link ubsan.c into libc.

This is a clean-room reimplementation from scratch of the Undefined
Behavior runtime called micro-UBSan (or uBSan - user-UBSan).
2018-08-03 04:29:35 +00:00
kamil
7517542c29 Disable sanitization of -fsanitize=function in libc
Generated code for the checks (in at least libunwind) depends on the C++
runtime feature of RTTI.

Pass -fno-sanitize=function to LIBCSANITIZERFLAGS.
2018-08-03 02:29:35 +00:00
rjs
f78bd2661d Add missing SCTP manpage. 2018-08-02 10:18:19 +00:00
rjs
97b85c8c95 Add userland support for SCTP and manpages. 2018-08-02 08:40:47 +00:00
ryo
90a07881a6 fix long double NaN definition. 2018-08-01 19:59:49 +00:00
sevan
8757822cde Remove ISO references 2018-07-31 22:28:26 +00:00
rjs
4dbc455943 Userland changes for getsockopt2(). 2018-07-31 13:04:09 +00:00
kre
65afe3be98 PR lib/53477 (rudolf at eq.cz) - correct an obvious mistake. 2018-07-28 14:00:19 +00:00
maya
726d0d156a it's C18, not C17. 2018-07-27 15:15:30 +00:00
maya
b91e8b8ee6 Claim C17 (although I'm unsure), add a note about C11's requirements. 2018-07-27 14:34:44 +00:00
maya
8d702a64ca C17 conformance: aligned_alloc's size doesn't need to be a multiple of
alignment any more.

Thanks Joseph Myers for the heads up.
2018-07-27 13:08:47 +00:00
kamil
1ec5b47878 Specify NOLIBCSANITIZER in lib/csu
The low-level libraries in csu are used in non-sanitized code.
2018-07-26 01:25:23 +00:00
kamil
21d1b523b3 Avoid undefined behavior in ftok(3)
Do not change the signedness bit with a left shift operation.
Cast to unsigned integer to prevent this.

ftok.c:56:10, left shift of 123456789 by 24 places cannot be represented in type 'int'
ftok.c:56:10, left shift of 4160 by 24 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.
2018-07-26 00:05:28 +00:00
kamil
1a4c49b997 Avoid undefined behavior in the definition of LAST_FRAG in xdr_rec.c
Do not change the signedness bit with a left shift operation.
Switch to unsigned integer to prevent this in the LAST_FRAG symbol.

xdr_rec.c:559:39, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:572:26, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:573:25, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:632:37, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:711:32, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:722:28, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.
2018-07-25 23:59:08 +00:00
kamil
f34d1bdd0f Avoid undefined behavior in left bit shift in jemalloc(3)
Change the type of shifted value to unsigned to prevent altering the
signedness bit.

jemalloc.c:1707:14, left shift of 1 by 31 places cannot be represented in type 'int'
jemalloc.c:1724:15, left shift of 1 by 31 places cannot be represented in type 'int'
jemalloc.c:1840:28, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.
2018-07-25 20:05:35 +00:00
ryo
ac20698df5 fix a bug. no need postincrement here. 2018-07-20 12:19:07 +00:00
joerg
eb13f74bfc The fpu mode for VFP2 instructions is still just vfp. 2018-07-19 19:35:02 +00:00
joerg
1b0031d44e Push FPU choice into the assembler sources themselve. 2018-07-17 15:03:48 +00:00
joerg
700ad9d05d Determine dynamic binaries by presence of PT_INTERP. Static PIE has
_DYNAMIC.
2018-07-13 19:50:21 +00:00
joerg
bf395f73c9 Compute relocbase correctly for static PIE. AT_BASE is not usable in
this case.
2018-07-13 19:49:47 +00:00
kre
96ef5eaedd i386/amd64 build fix. Fix "possibly used uninitialized" from gcc.
These changes should make no practical effect - but because external
data is being examined, it would be possible to contrive a situation
(perhaps) where uninit'd vars could actually be used (unless the format
has been checked elsewhere earlier - I did not look ... we have to
appease gcc anyway).

Joerg: Please review (& fix)
2018-07-13 01:00:17 +00:00
joerg
26c47810f2 Add static PIE support for i386 and AMD64.
The basic glue works with mininal changes for other architectures as
well, but those require linker changes first to avoid leaking dynamic
relocations into the binary.
2018-07-12 21:36:45 +00:00
joerg
c0d91a1260 _DYNAMIC is present for static PIE as well, so loosen rtld check. 2018-07-12 21:35:12 +00:00
maxv
62c8988166 Remove the kernel PMC code. Sent yesterday on tech-kern@.
This change:

 * Removes "options PERFCTRS", the associated includes, and the associated
   ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
   good.

 * Removes the PMC code of ARM XSCALE.

 * Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

 * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
   definitions are put in sysarch.h.

 * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
   and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
   netbsd32 and rump.

 * Removes the pmc_evid_t and pmc_ctr_t types.

 * Removes all the associated man pages. The sets are marked as obsolete.
2018-07-12 10:46:40 +00:00
maxv
18f65af8ea Retire libpmc. It uses the legacy PMC interface in the kernel, which has
support for only one ARM CPU. It used to have x86 support, but it was broken
and I removed it. The legacy PMC interface will be removed from the kernel
too. Sent on tech-kern@ yesterday, thorpej was fine.
2018-07-12 06:52:48 +00:00
christos
1765287814 revert previous now that MAP_ALIGNED has been fixed. 2018-07-09 00:47:47 +00:00
christos
0dba751ea2 switch to FreeBSD's memmem 2018-07-08 17:53:42 +00:00
christos
de03d6cb9a correct previous cast. 2018-07-08 16:48:47 +00:00
christos
606587dd27 cast for lint 2018-07-08 16:39:27 +00:00
msaitoh
8402962f31 Indent. 2018-07-04 07:38:38 +00:00
christos
a17e2f9d4b use a switch. 2018-06-30 16:05:44 +00:00
christos
0fd9ea3645 put back lsan 2018-06-28 10:14:01 +00:00
ozaki-r
79209cd2af rumphijack: don't modify a cmsg on just validating it
Pointed out by k-goda@IIJ
2018-06-28 06:20:36 +00:00
dholland
bc382992a0 Describe what this actually does. Bump date. 2018-06-25 01:21:21 +00:00
kamil
171790efcf Fix stack use after scope in libutil/pty
The pt variable's elements are used after the end of the pt scope.
A move of pt to outer scope fixes this.

Detected with MKSANITIZER/ASan with tmux(1), a forkpty(3) user.
2018-06-24 09:30:26 +00:00
kamil
b2b644497e Prevent underflow buffer read in trim_whitespace() in libutil/passwd.c
If a string is empty or contains only white characters, the algorithm of
removal of white characters at the end of the passed string will read
buffer at index -1 and keep iterating backward.

Detected with MKSANITIZER/ASan when executing passwd(1).
2018-06-24 01:53:14 +00:00
kamil
bef3ed2e02 Disable MKSANITIZER in lib/csu
These low-level libraries are expected to be not touched by a sanitizer.
Every libc program not using sanitizers cannot work with sanitized csu.
2018-06-16 18:58:00 +00:00
dholland
d8a5b30306 atomic_and/atomic_or do bitwise ops, not logical ops. 2018-06-16 08:11:32 +00:00
eadler
8ddc25ac24 libc: remove explicit cast NULL in atoi
There isn't any reason to cast NULL so just remove it. A similar change
was already made in DragonFly and FreeBSD (by me).

ok fly@
2018-06-13 09:38:32 +00:00
kamil
0d6563db8b Disable sanitizers for libm and librt
The sanitizers are designed to use pristine OS versions of these libraries,
install interceptors for public symbols in them and link with them in every
sanitized executable.

Having unmodified base libraries (c, m, rt, pthread) also makes the system
usable with programs linking with them and without sanitization, as there
are no fatal issues during the resolving of missing symbols.

The remaining libraries like libutil, libintl etc are prebuilt with
sanitization and all their users in the MKSANITIZER=yes distribution are
required to use the same sanitizer.

libc and libpthread are already marked with the NOSANITIZER flag.
2018-06-13 08:19:36 +00:00
maya
9616ec28db Avoid left-shifting a negative number in the non-compat case, too. 2018-06-11 20:28:23 +00:00
kamil
5a889623ce Correct Undefined Behavior in libc/citrus
Unportable left shift reported with MKSANITIZER=yes USE_SANITIZER=undefined:

# nm /usr/lib/libc.so|grep sanit
/public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Sponsored by <The NetBSD Foundation>
2018-06-11 18:03:38 +00:00