freebsd-dev/sys/dev/isci
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
..
scil Fix improper use of "its". 2016-11-08 23:59:41 +00:00
environment.h
isci_controller.c Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name) 2017-01-04 20:26:42 +00:00
isci_domain.c
isci_interrupt.c isci: check return value of pci_alloc_msix() 2015-09-08 16:05:18 +00:00
isci_io_request.c sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
isci_logger.c
isci_oem_parameters.c As <machine/pmap.h> is included from <vm/pmap.h>, there is no need to 2016-02-22 09:02:20 +00:00
isci_remote_device.c
isci_sysctl.c
isci_task_request.c Pass proper arguments (handles, not directly structure pointers) to 2016-12-28 14:50:39 +00:00
isci_timer.c sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
isci.c Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any() 2016-02-19 03:37:56 +00:00
isci.h
README
sci_environment.h
types.h

FreeBSD Driver for Intel(R) C600 SAS Controller
===============================================

This driver has been developed for use with FreeBSD, version 9.0 and later.

This driver uses an OS-agnostic abstraction layer library named SCIL that is
published by Intel specifically for the C600 SAS controller.  The SAS
controller has no firmware, so the driver is extensive and using SCIL
minimizes the development and maintenance cost of the driver.

The FreeBSD implementation files are in the isci directory, and SCIL files
are in the isci/scil subdirectory.  As Intel publishes new versions of SCIL
(to add features or fix bugs), the isci/scil subdirectory will be updated
appropriately.