freebsd-dev/contrib
Jessica Clarke 224a95f124 libfido2: Address CHERI compatibility
Cherry-picked from libfido2 upstream f20a735c0a6f:

iso7816: Avoid storing pointers in a packed structure

On CHERI, and thus Arm's experimental Morello prototype architecture,
pointers are represented as capabilities, which are unforgeable bounded
pointers, providing always-on fine-grained spatial memory safety. The
unforgeability is enforced through the use of tagged memory, with one
validity tag bit per capability-sized-and-aligned word in memory. This
means that storing a pointer to an unaligned location, which is not
guaranteed to work per the C standard, either traps or results in the
capability losing its tag (and thus never being dereferenceable again),
depending on how exactly the store is done (specifically, whether a
capability store or memcpy is used).

However, iso7816 itself does not need to be packed, and doing so likely
causes inefficiencies on existing architectures. The iso7816_header_t
member is packed, and the flexible payload array is a uint8_t (which by
definition has no padding bits and is exactly 8 bits in size and, since
CHAR_BITS must be at least 8, its existence implies that it has the same
representation as unsigned char, and that it has size and alignment 1)
so there will never be any padding inserted between header and payload
(but payload may overlap with padding at the end of the struct due to
how flexible arrays work, which means we need to be careful about our
calculations).

Co-authored-by: pedro martelletto <pedro@yubico.com>
2021-10-06 21:40:26 -04:00
..
arm-optimized-routines Import Arm Optimized Routines v21.02 2021-07-06 11:05:34 +01:00
atf Import atf 0.22 snapshot 55c21b2c5fb189bbdfccb2b297bfa89236502542 2021-09-10 17:08:42 -06:00
bc contrib/bc: update to version 5.1.1 2021-10-06 23:30:59 +02:00
bearssl
blacklist blacklistd.conf.5: typo/grammar fixes 2020-05-19 00:15:19 +00:00
bmake make: fix MAKE_JOB_ERROR_TOKEN 2021-09-10 13:11:28 -07:00
bsnmp Fix bsnmpd(1) crash with ill-formed Discovery message 2021-10-01 14:10:39 +03:00
byacc yacc: Regen test cases for the previous commit 2021-02-11 18:41:28 -05:00
bzip2
capsicum-test Re-enable network ioctls in capability mode 2021-04-23 09:22:49 -04:00
com_err
cortex-strings
dialog dialog: fix macro redefinition 2021-03-01 16:01:44 +01:00
diff Fix macro-redefined warning in gnu/diff for fputc_unlocked 2021-01-19 21:23:25 +00:00
dma dma: import snapshot 2021-07-10 2021-09-22 11:10:58 +02:00
ee ee: restore the stdin/stdout terminal check 2021-04-12 00:48:45 +03:00
elftoolchain readelf: document that -u / --unwind is not yet implemented 2021-09-17 10:22:05 -04:00
expat
file Revert r362261, "Re-apply r333944 to unbreak ports" 2020-06-29 13:30:48 +00:00
flex contrib/flex: Drop local __dead2 patch 2021-04-21 10:54:59 +01:00
gdtoa
googletest Re-enable disabled googletest-port-test tests after r363820 2020-08-04 02:20:15 +00:00
hyperv/tools
ipfilter Simplify the FreeBSD check using __FreeBSD__ compiler macro. 2021-02-08 16:36:27 -08:00
jemalloc Fix abort in jemalloc extent coalescing. 2020-12-18 10:09:21 +00:00
kyua Revert r359385-r359387 2020-03-29 02:40:03 +00:00
ldns Fix crash in drill(1) when IP has two subsequent dots 2020-06-22 23:13:14 +00:00
ldns-host
less less: upgrade to v590. 2021-07-17 22:20:44 -07:00
lib9p Import lib9p 9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c. 2020-10-03 18:52:54 +00:00
libarchive libarchive: import bugfix from upstream 2021-08-27 12:51:01 +02:00
libbegemot
libc-pwcache pwcache.3: Explicitly document OOM condition 2020-05-05 17:55:45 +00:00
libc-vis vis(3): avoid out-of-bounds stack buffer reads 2021-06-16 16:27:13 +01:00
libcbor Import libcbor at 'contrib/libcbor/' 2021-10-06 20:26:10 -04:00
libcxxrt Partially revert libcxxrt changes to avoid _Unwind_Exception change 2021-03-13 14:54:24 +01:00
libdivsufsort
libedit libedit: import snapshot 2021-09-10 2021-09-22 10:19:43 +02:00
libevent
libexecinfo Pull in fix from upstream NetBSD rev. 1.5: 2020-09-21 16:43:38 +00:00
libfido2 libfido2: Address CHERI compatibility 2021-10-06 21:40:26 -04:00
libpcap
libucl Fix build post a040967612. 2021-03-22 08:42:18 -07:00
libxo Import libxo-1.4.0: 2020-01-25 21:16:45 +00:00
llvm-project compiler-rt: add aarch64 init function for LSE atomics 2021-09-06 21:24:01 +02:00
lua contrib/lua: update to 5.4.2 2021-01-13 23:56:18 -06:00
lutok Add liblutok a lightweight C++ API for lua. 2020-03-23 18:26:23 +00:00
mandoc flua: Add a libjail module 2020-10-24 17:08:59 +00:00
mknod
mtree fts_read: Handle error from a NULL return better. 2020-12-08 23:38:26 +00:00
ncurses ncurses: Apply a tputs() fix from patch 20210403 2021-08-11 13:08:23 -04:00
netbsd-tests time_t is pathological: use %j + cast to print it. 2021-10-01 12:16:10 -06:00
netcat Adjust .Dd, missed in r363084. 2020-07-10 19:58:07 +00:00
ngatm
ntp MFV r362565: 2020-06-24 01:51:05 +00:00
nvi Allow building usr.bin/vi with MK_ASAN 2021-07-19 15:04:19 +01:00
ofed ibstat: Include prototype for sysctlbyname(). 2021-05-27 09:42:30 +02:00
one-true-awk awk: document updating 2021-08-01 11:31:50 -06:00
openbsm close_range: add audit support 2021-02-23 17:47:07 +00:00
opencsd/decoder Update opencsd to 0.14.2 2020-06-17 10:42:20 +00:00
openpam Merge upstream r948: fix race condition in openpam_ttyconv(3). 2020-11-19 05:46:59 +00:00
openresolv
opie
pam_modules/pam_passwdqc
pf ftp-proxy: Revert incorrect migration to libpfctl 2021-07-01 21:34:40 +02:00
pjdfstest
pnglite pnglite: should use ntohl 2021-01-12 00:56:35 +02:00
pnpinfo
processor-trace
sendmail Key decleration of union semun on src version 2020-10-26 17:52:28 +00:00
smbfs
sqlite3 sqlite3: import sqlite3 3.35.5 2021-05-06 18:01:44 -07:00
tcp_wrappers tcp_wrappers: get rid of duplicate fgets declarations 2021-09-30 23:55:27 -05:00
tcpdump tcpdump: decode packets on pfsync interfaces 2021-07-13 13:29:52 +02:00
tcsh tcsh: update to version 6.22.04. 2021-05-20 00:12:27 +03:00
telnet telnet(1): add quiet mode ("telnet -Q") 2021-06-21 17:11:57 +01:00
terminus contrib: setup terminus 2021-01-02 21:03:28 +02:00
tnftp Fix poor performance of ftp(1) due to small SO_SNDBUF and SO_RCVBUF. 2020-02-27 19:49:59 +00:00
traceroute ping: fix some man pages and tests after r368045 2020-11-26 04:55:02 +00:00
tzcode tzcode: Fix operation without WITH_DETECT_TZ_CHANGES 2021-09-14 20:17:50 +00:00
tzdata contrib/tzdata: import tzdata 2021c 2021-10-02 10:52:02 +08:00
unbound unbound: Vendor import 1.13.2 2021-08-17 02:32:56 -07:00
unvis
vis Merge tag 'vendor/NetBSD/vis/20210621' into vis 2021-06-21 18:04:17 -06:00
wpa wpa: Import wpa_supplicant/hostapd commits up to b4f7506ff 2021-09-03 06:08:41 -07:00
xz liblzma: Make liblzma use libmd implementation of SHA256. 2020-06-20 21:32:07 +00:00