opnsense-src/sys
Alan Somers 4195c7de24 Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)
The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".

This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.

PR:		215474
Reported by:	Coverity
CID:		1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID:		1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID:		1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID:		1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID:		1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID:		1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID:		1010035 1010036 1010042 1010041 1010040 1010039
Reviewed by:	imp, sephe, slm
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9037
Differential Revision:	https://reviews.freebsd.org/D9038
2017-01-04 20:26:42 +00:00
..
amd64 amd64: add atomic_fcmpset 2017-01-03 21:00:24 +00:00
arm ARM GENERIC: Add support for Allwinner A33 SoC 2017-01-04 03:37:00 +00:00
arm64 Add virtio_pci to GENERIC arm64 conf 2016-12-18 11:15:31 +00:00
boot Remove a GPL licensed DTS. 2017-01-03 16:46:51 +00:00
bsm
cam Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name) 2017-01-04 20:26:42 +00:00
cddl Revert r309619 "ifndef atomic_cas_* in cddl code" 2017-01-03 21:02:30 +00:00
compat Regen after r310638. 2016-12-27 20:22:17 +00:00
conf Allwinner: Add A33 support 2017-01-04 03:35:39 +00:00
contrib Merge CK as of commit 255a47553aa5e8d0bb5f8eec63acac7f4c25a6d8, mostly 2016-12-30 18:23:58 +00:00
crypto Add accelerated AES with using the ARMv8 crypto instructions. This is based 2016-11-21 11:18:00 +00:00
ddb Use casts to force an unsigned comparison in db_search_symbol(). 2016-12-14 00:18:12 +00:00
dev Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name) 2017-01-04 20:26:42 +00:00
fs Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem. 2017-01-02 19:18:56 +00:00
gdb
geom build: Unbreak LINT 2016-12-21 01:39:11 +00:00
gnu Add Ingenic X1000 DTS files (unofficial). 2016-11-19 15:03:49 +00:00
i386 Move the objects used to create temporary mappings for i386 pmap zero and copy 2016-12-23 15:14:56 +00:00
isa
kern The callers of kern_getfsstat(UIO_SYSSPACE) expect that *buf always 2017-01-04 16:09:45 +00:00
kgssapi
libkern Update r309143 to prevent false sharing. 2016-11-25 17:20:23 +00:00
mips Remove duplicate iic and iicbus devices from JZ4780 kernel 2017-01-04 18:36:30 +00:00
modules cxgbe(4): Update T4, T5 and T6 firmwares to 1.16.26.0. Changelog for 2017-01-03 22:05:07 +00:00
net 2017 IFLIB updates in preparation for commits to e1000 and ixgbe. 2017-01-02 00:56:33 +00:00
net80211 [net80211] Add VHT flags for printf/debugging. 2017-01-04 08:08:50 +00:00
netgraph Changes to allow the patching of packets with an offset (and other changes.. see man page) 2016-12-02 10:47:10 +00:00
netinet Followup to mtod removal in main stack (r311225). Continued removal 2017-01-04 04:00:28 +00:00
netinet6 Whitespace changes. 2016-12-26 11:06:41 +00:00
netipsec Add a missing header 2016-11-26 23:15:11 +00:00
netnatm
netpfil Improve upon r309394 2016-12-10 03:31:38 +00:00
netsmb
nfs Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
nfsclient
nfsserver
nlm When sleeping waiting for either local or remote advisory lock, 2016-06-26 20:08:42 +00:00
ofed Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4 2016-09-30 08:23:06 +00:00
opencrypto Add support for the fpu_kern(9) KPI on arm64. It hooks into the existing 2016-10-20 09:22:10 +00:00
pc98 Add a COMPAT_FREEBSD11 kernel option. 2016-12-09 18:54:12 +00:00
powerpc Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name) 2017-01-04 20:26:42 +00:00
riscv Disable superpages reservations as we don't have implemented them yet. 2016-11-21 12:00:31 +00:00
rpc Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
security Audit 'fd' and 'cmd' arguments to fcntl(2), and when generating BSM, 2016-11-22 00:41:24 +00:00
sparc64 Add support for encrypted kernel crash dumps. 2016-12-10 16:20:39 +00:00
sys mtx: reduce lock accesses 2017-01-03 21:36:15 +00:00
teken
tests
tools Consider CROSS_BINUTILS_PREFIX environment variable so we use correct 2016-08-10 13:49:17 +00:00
ufs Release laundered vnode pages to the head of the inactive queue. 2016-11-23 17:53:07 +00:00
vm Add a page queue for holding dirty anonymous unswappable pages. 2017-01-03 00:05:44 +00:00
x86 xen: fix IPI setup with EARLY_AP_STARTUP 2016-12-22 16:09:44 +00:00
xdr
xen xen: fix IPI setup with EARLY_AP_STARTUP 2016-12-22 16:09:44 +00:00
Makefile