freebsd-dev/lib
Conrad Meyer e9ac27430c Implement getrandom(2) and getentropy(3)
The general idea here is to provide userspace programs with well-defined
sources of entropy, in a fashion that doesn't require opening a new file
descriptor (ulimits) or accessing paths (/dev/urandom may be restricted
by chroot or capsicum).

getrandom(2) is the more general API, and comes from the Linux world.
Since our urandom and random devices are identical, the GRND_RANDOM flag
is ignored.

getentropy(3) is added as a compatibility shim for the OpenBSD API.

truss(1) support is included.

Tests for both system calls are provided.  Coverage is believed to be at
least as comprehensive as LTP getrandom(2) test coverage.  Additionally,
instructions for running the LTP tests directly against FreeBSD are provided
in the "Test Plan" section of the Differential revision linked below.  (They
pass, of course.)

PR:		194204
Reported by:	David CARLIER <david.carlier AT hardenedbsd.org>
Discussed with:	cperciva, delphij, jhb, markj
Relnotes:	maybe
Differential Revision:	https://reviews.freebsd.org/D14500
2018-03-21 01:15:45 +00:00
..
atf DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
clang Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 2018-03-04 17:06:37 +00:00
csu lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
lib80211 DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libalias DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libarchive MFV r328323,328324: 2018-01-24 14:24:17 +00:00
libauditd DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libbegemot DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libblacklist DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libblocksruntime DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libbluetooth lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libbsdstat lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libbsm DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libbsnmp DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libbz2 DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libc Implement getrandom(2) and getentropy(3) 2018-03-21 01:15:45 +00:00
libc_nonshared lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libc++ DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libc++experimental DIRDEPS_BUILD: Connect more libraries. 2017-07-11 00:32:48 +00:00
libcalendar lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libcam SPDX: Small for a license ID tags. 2017-12-27 21:36:37 +00:00
libcapsicum capsicum_helpers: Add EVENT to default stdio rights set 2017-10-08 17:29:43 +00:00
libcasper The gids argument can be declared as const. 2018-03-18 19:50:32 +00:00
libclang_rt Only build tsan and tsan_cxx for amd64, as 32 bit is unsupported. 2017-12-25 13:17:29 +00:00
libcom_err DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libcompat libcompat: Use %hu for unsigned shorts. 2018-02-10 14:45:29 +00:00
libcompiler_rt The routines defined in comparedf2 and comparesf2 are defined in libc 2018-02-02 05:04:43 +00:00
libcrypt lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libcuse DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libcxxrt libcxxrt: Move mangled symbols out of extern "C++" in Version.map 2018-01-23 22:41:13 +00:00
libdevctl DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libdevdctl zfsd: Allow zfsd to work on any type of GEOM provider 2018-02-14 23:52:39 +00:00
libdevinfo Bump number that's an insane number of devices from 1,000 to 10,000. I 2017-12-21 04:21:59 +00:00
libdevstat lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libdl DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libdpv Bump copyright following recent changes 2018-03-14 20:55:28 +00:00
libdwarf DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libedit libedit: sort the Makefile in line with NetBSD's version. 2018-01-29 22:38:23 +00:00
libefivar libefivar: use standard 2-Clause FreeBSD license 2018-03-02 15:12:18 +00:00
libelf DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libelftc libelftc: bump version, tracking import in r320343 2017-07-05 02:58:46 +00:00
libevent DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libexecinfo DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libexpat DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libfetch SPDX: use the Beerware identifier. 2017-11-30 20:33:45 +00:00
libfigpar Bump copyright following recent changes 2018-03-14 20:55:28 +00:00
libgcc_eh DIRDEPS_BUILD: libgcc now depends on MK_LLVM_LIBUNWIND 2017-10-31 00:03:36 +00:00
libgcc_s Fix build by escaping a line break. 2018-01-31 21:41:42 +00:00
libgeom lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libgpio DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libgssapi lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libiconv_modules iconv: adding missing break 2018-01-21 21:09:08 +00:00
libifconfig libifconfig: multiple feature additions 2018-02-23 03:11:43 +00:00
libipsec Update pfkey_open() function to set socket's write buffer size to 2018-03-11 19:26:34 +00:00
libjail lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libkiconv lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libkvm lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libldns DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
liblzma DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libmagic LIB32: Avoid linking in unneeded (and invalid lib32) libz for libmagic build tool. 2018-03-09 18:51:24 +00:00
libmd Fix formatting errors that resulted in apropos(1) output looking weird. 2018-03-17 11:41:06 +00:00
libmemstat Implement NUMA support in uma(9) and malloc(9). Allocations from specific 2018-01-12 23:25:05 +00:00
libmilter DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libmp lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libmt Add the LTO-8 Type M density code (0x5d, LTO-8M) to libmt and the 2017-11-03 21:04:22 +00:00
libnandfs lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libnetbsd libnetbsd: Make the function declaration of efopen() match the definition 2018-01-16 21:43:21 +00:00
libnetgraph s/NgSendMsgReply/NgSendReplyMsg/ in man to match the code. 2017-11-08 12:34:47 +00:00
libngatm DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libnv lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libopenbsd Fix a few more speelling errors 2017-12-28 01:31:28 +00:00
libopie DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libpam lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libpathconv Disconnect libpathconv tests since they require external perl and do not work with kyua. 2017-10-31 19:52:30 +00:00
libpcap DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libpe Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones 2017-01-20 04:37:03 +00:00
libpjdlog lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libpmc Fix pmcstat exit from kernel introduced by r325275. 2018-01-17 16:41:22 +00:00
libpmcstat Fix bug: increment the value of pmcstat_npmcs instead of moving pointer 2018-01-16 09:31:01 +00:00
libproc Use a global extern declaration to appease gcc. 2017-12-06 17:52:01 +00:00
libprocstat lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libradius lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libregex libregex: Mark gnuext test as an expected fail 2018-01-29 14:00:33 +00:00
librpcsec_gss lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
librpcsvc spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
librss DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
librt lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
librtld_db lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libsbuf DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libsdp lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libsm Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones 2017-01-20 04:35:36 +00:00
libsmb DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libsmdb Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones 2017-01-20 04:35:18 +00:00
libsmutil Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones 2017-01-20 04:34:34 +00:00
libsqlite3 DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libstdbuf lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libstdthreads lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libsysdecode Chase r331057 in libsysdecode erno table 2018-03-16 15:15:25 +00:00
libtacplus lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libtelnet Remove redundant include directories which expand to a noop, 2017-07-31 19:07:45 +00:00
libthr libthr: Fix missing break in switch. 2018-01-27 22:27:55 +00:00
libthread_db lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libucl DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libufs Revert r313780 (UFS_ prefix) 2018-03-17 12:59:55 +00:00
libugidfw lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libulog lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libunbound DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libusb lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libusbhid lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libutil open.3: Use .Fa where appropriate 2018-03-04 18:00:32 +00:00
libvgl lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libvmmapi Add a new variant of the GLA2GPA ioctl for use by the debug server. 2018-02-26 19:19:05 +00:00
libwrap DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libxo DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
liby General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
libypclnt lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
libz DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
libzstd lib(private)zstd: Fix riscv build 2018-03-18 03:42:57 +00:00
msun msun: signed overflow in atan2 2018-02-14 07:59:30 +00:00
ncurses General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
Makefile Add libregex, connect it to the build 2018-01-22 02:44:41 +00:00
Makefile.inc