svn commit: r315813 - in stable/10/sys: cam cam/ctl cam/scsi dev/aac dev/aacraid dev/advansys dev/aha dev/ahb dev/ahci dev/aic dev/aic7xxx dev/amr dev/arcmsr dev/ata dev/buslogic dev/ciss dev/dpt d...
Alexander Motin
mav at FreeBSD.org
Thu Mar 23 06:41:20 UTC 2017
Author: mav
Date: Thu Mar 23 06:41:13 2017
New Revision: 315813
URL: https://svnweb.freebsd.org/changeset/base/315813
Log:
MFC r311305 (by asomers):
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
Modified:
stable/10/sys/cam/cam_xpt.c
stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c
stable/10/sys/cam/scsi/scsi_low.c
stable/10/sys/dev/aac/aac_cam.c
stable/10/sys/dev/aacraid/aacraid_cam.c
stable/10/sys/dev/advansys/advansys.c
stable/10/sys/dev/advansys/adwcam.c
stable/10/sys/dev/aha/aha.c
stable/10/sys/dev/ahb/ahb.c
stable/10/sys/dev/ahci/ahci.c
stable/10/sys/dev/ahci/ahciem.c
stable/10/sys/dev/aic/aic.c
stable/10/sys/dev/aic7xxx/aic79xx_osm.c
stable/10/sys/dev/aic7xxx/aic7xxx_osm.c
stable/10/sys/dev/amr/amr_cam.c
stable/10/sys/dev/arcmsr/arcmsr.c
stable/10/sys/dev/ata/ata-all.c
stable/10/sys/dev/buslogic/bt.c
stable/10/sys/dev/ciss/ciss.c
stable/10/sys/dev/dpt/dpt_scsi.c
stable/10/sys/dev/esp/ncr53c9x.c
stable/10/sys/dev/firewire/sbp.c
stable/10/sys/dev/firewire/sbp_targ.c
stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
stable/10/sys/dev/hptiop/hptiop.c
stable/10/sys/dev/hptmv/entry.c
stable/10/sys/dev/hptnr/hptnr_osm_bsd.c
stable/10/sys/dev/hptrr/hptrr_osm_bsd.c
stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
stable/10/sys/dev/iir/iir.c
stable/10/sys/dev/isci/isci_controller.c
stable/10/sys/dev/iscsi_initiator/isc_cam.c
stable/10/sys/dev/isp/isp_freebsd.c
stable/10/sys/dev/mfi/mfi_cam.c
stable/10/sys/dev/mly/mly.c
stable/10/sys/dev/mpr/mpr_sas.c
stable/10/sys/dev/mps/mps_sas.c
stable/10/sys/dev/mpt/mpt_cam.c
stable/10/sys/dev/mrsas/mrsas_cam.c
stable/10/sys/dev/mvs/mvs.c
stable/10/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
stable/10/sys/dev/ppbus/vpo.c
stable/10/sys/dev/siis/siis.c
stable/10/sys/dev/sym/sym_hipd.c
stable/10/sys/dev/trm/trm.c
stable/10/sys/dev/twa/tw_osl_cam.c
stable/10/sys/dev/tws/tws_cam.c
stable/10/sys/dev/virtio/scsi/virtio_scsi.c
stable/10/sys/powerpc/ps3/ps3cdrom.c
stable/10/sys/powerpc/pseries/phyp_vscsi.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cam/cam_xpt.c
==============================================================================
--- stable/10/sys/cam/cam_xpt.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/cam/cam_xpt.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -5144,9 +5144,9 @@ xptaction(struct cam_sim *sim, union ccb
cpi->max_target = 0;
cpi->max_lun = 0;
cpi->initiator_id = 0;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "", HBA_IDLEN);
- strncpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "", HBA_IDLEN);
+ strlcpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
cpi->unit_number = sim->unit_number;
cpi->bus_id = sim->bus_id;
cpi->base_transfer_speed = 0;
Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -786,9 +786,9 @@ cfcs_action(struct cam_sim *sim, union c
cpi->hpath_id = 0;
cpi->initiator_id = 0;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "FreeBSD", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "FreeBSD", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = 0;
cpi->bus_id = 0;
cpi->base_transfer_speed = 800000;
Modified: stable/10/sys/cam/scsi/scsi_low.c
==============================================================================
--- stable/10/sys/cam/scsi/scsi_low.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/cam/scsi/scsi_low.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -741,9 +741,9 @@ settings_out:
cpi->transport_version = 2;
cpi->protocol = PROTO_SCSI;
cpi->protocol_version = SCSI_REV_2;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "SCSI_LOW", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "SCSI_LOW", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb);
Modified: stable/10/sys/dev/aac/aac_cam.c
==============================================================================
--- stable/10/sys/dev/aac/aac_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/aac/aac_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -317,9 +317,9 @@ aac_cam_action(struct cam_sim *sim, unio
cpi->initiator_id = camsc->inf->InitiatorBusId;
cpi->bus_id = camsc->inf->BusNumber;
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
Modified: stable/10/sys/dev/aacraid/aacraid_cam.c
==============================================================================
--- stable/10/sys/dev/aacraid/aacraid_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/aacraid/aacraid_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1039,9 +1039,9 @@ aac_cam_action(struct cam_sim *sim, unio
cpi->transport_version = 0;
cpi->protocol_version = SCSI_REV_SPC2;
#endif
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "PMC-Sierra", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "PMC-Sierra", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
ccb->ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb);
Modified: stable/10/sys/dev/advansys/advansys.c
==============================================================================
--- stable/10/sys/dev/advansys/advansys.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/advansys/advansys.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -429,9 +429,9 @@ adv_action(struct cam_sim *sim, union cc
cpi->initiator_id = adv->scsi_id;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Advansys", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Advansys", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->ccb_h.status = CAM_REQ_CMP;
cpi->transport = XPORT_SPI;
Modified: stable/10/sys/dev/advansys/adwcam.c
==============================================================================
--- stable/10/sys/dev/advansys/adwcam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/advansys/adwcam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -710,9 +710,9 @@ adw_action(struct cam_sim *sim, union cc
cpi->initiator_id = adw->initiator_id;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "AdvanSys", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "AdvanSys", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
Modified: stable/10/sys/dev/aha/aha.c
==============================================================================
--- stable/10/sys/dev/aha/aha.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/aha/aha.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -949,9 +949,9 @@ ahaaction(struct cam_sim *sim, union ccb
cpi->initiator_id = aha->scsi_id;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
Modified: stable/10/sys/dev/ahb/ahb.c
==============================================================================
--- stable/10/sys/dev/ahb/ahb.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/ahb/ahb.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1179,9 +1179,9 @@ ahbaction(struct cam_sim *sim, union ccb
cpi->initiator_id = ahb->scsi_id;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
Modified: stable/10/sys/dev/ahci/ahci.c
==============================================================================
--- stable/10/sys/dev/ahci/ahci.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/ahci/ahci.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -2637,9 +2637,9 @@ ahciaction(struct cam_sim *sim, union cc
cpi->initiator_id = 0;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 150000;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "AHCI", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "AHCI", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SATA;
cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
Modified: stable/10/sys/dev/ahci/ahciem.c
==============================================================================
--- stable/10/sys/dev/ahci/ahciem.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/ahci/ahciem.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -578,9 +578,9 @@ ahciemaction(struct cam_sim *sim, union
cpi->initiator_id = 0;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 150000;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "AHCI", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "AHCI", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SATA;
cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
Modified: stable/10/sys/dev/aic/aic.c
==============================================================================
--- stable/10/sys/dev/aic/aic.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/aic/aic.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -281,9 +281,9 @@ aic_action(struct cam_sim *sim, union cc
cpi->initiator_id = aic->initiator;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
Modified: stable/10/sys/dev/aic7xxx/aic79xx_osm.c
==============================================================================
--- stable/10/sys/dev/aic7xxx/aic79xx_osm.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/aic7xxx/aic79xx_osm.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -699,9 +699,9 @@ ahd_action(struct cam_sim *sim, union cc
}
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->protocol = PROTO_SCSI;
cpi->protocol_version = SCSI_REV_2;
Modified: stable/10/sys/dev/aic7xxx/aic7xxx_osm.c
==============================================================================
--- stable/10/sys/dev/aic7xxx/aic7xxx_osm.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/aic7xxx/aic7xxx_osm.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -797,9 +797,9 @@ ahc_action(struct cam_sim *sim, union cc
}
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->protocol = PROTO_SCSI;
cpi->protocol_version = SCSI_REV_2;
Modified: stable/10/sys/dev/amr/amr_cam.c
==============================================================================
--- stable/10/sys/dev/amr/amr_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/amr/amr_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -323,9 +323,9 @@ amr_cam_action(struct cam_sim *sim, unio
cpi->max_target = AMR_MAX_TARGETS;
cpi->max_lun = 0 /* AMR_MAX_LUNS*/;
cpi->initiator_id = 7; /* XXX variable? */
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "LSI", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "LSI", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 132 * 1024; /* XXX */
Modified: stable/10/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- stable/10/sys/dev/arcmsr/arcmsr.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/arcmsr/arcmsr.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -2901,9 +2901,9 @@ static void arcmsr_action(struct cam_sim
cpi->max_lun = ARCMSR_MAX_TARGETLUN; /* 0-7 */
cpi->initiator_id = ARCMSR_SCSI_INITIATOR_ID; /* 255 */
cpi->bus_id = cam_sim_bus(psim);
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "ARCMSR", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "ARCMSR", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(psim);
#ifdef CAM_NEW_TRAN_CODE
if(acb->adapter_bus_speed == ACB_BUS_SPEED_12G)
Modified: stable/10/sys/dev/ata/ata-all.c
==============================================================================
--- stable/10/sys/dev/ata/ata-all.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/ata/ata-all.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1162,9 +1162,9 @@ ataaction(struct cam_sim *sim, union ccb
cpi->base_transfer_speed = 150000;
else
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "ATA", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "ATA", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
if (ch->flags & ATA_SATA)
cpi->transport = XPORT_SATA;
Modified: stable/10/sys/dev/buslogic/bt.c
==============================================================================
--- stable/10/sys/dev/buslogic/bt.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/buslogic/bt.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1369,9 +1369,9 @@ btaction(struct cam_sim *sim, union ccb
cpi->initiator_id = bt->scsi_id;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "BusLogic", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "BusLogic", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->ccb_h.status = CAM_REQ_CMP;
cpi->transport = XPORT_SPI;
Modified: stable/10/sys/dev/ciss/ciss.c
==============================================================================
--- stable/10/sys/dev/ciss/ciss.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/ciss/ciss.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -3026,9 +3026,9 @@ ciss_cam_action(struct cam_sim *sim, uni
cpi->max_target = sc->ciss_cfg->max_logical_supported;
cpi->max_lun = 0; /* 'logical drive' channel only */
cpi->initiator_id = sc->ciss_cfg->max_logical_supported;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "msmith at freebsd.org", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "CISS", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 132 * 1024; /* XXX what to set this to? */
Modified: stable/10/sys/dev/dpt/dpt_scsi.c
==============================================================================
--- stable/10/sys/dev/dpt/dpt_scsi.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/dpt/dpt_scsi.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1027,9 +1027,9 @@ dpt_action(struct cam_sim *sim, union cc
cpi->initiator_id = dpt->hostid[cam_sim_bus(sim)];
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "DPT", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "DPT", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
Modified: stable/10/sys/dev/esp/ncr53c9x.c
==============================================================================
--- stable/10/sys/dev/esp/ncr53c9x.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/esp/ncr53c9x.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1013,9 +1013,9 @@ ncr53c9x_action(struct cam_sim *sim, uni
cpi->max_target = sc->sc_ntarg - 1;
cpi->max_lun = 7;
cpi->initiator_id = sc->sc_id;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "NCR", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "NCR", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = 0;
cpi->base_transfer_speed = 3300;
Modified: stable/10/sys/dev/firewire/sbp.c
==============================================================================
--- stable/10/sys/dev/firewire/sbp.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/firewire/sbp.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -2553,9 +2553,9 @@ END_DEBUG
cpi->initiator_id = SBP_INITIATOR;
cpi->bus_id = sim->bus_id;
cpi->base_transfer_speed = 400 * 1000 / 8;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "SBP", HBA_IDLEN);
- strncpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "SBP", HBA_IDLEN);
+ strlcpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
cpi->unit_number = sim->unit_number;
cpi->transport = XPORT_SPI; /* XX should have a FireWire */
cpi->transport_version = 2;
Modified: stable/10/sys/dev/firewire/sbp_targ.c
==============================================================================
--- stable/10/sys/dev/firewire/sbp_targ.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/firewire/sbp_targ.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1335,9 +1335,9 @@ sbp_targ_action1(struct cam_sim *sim, un
cpi->initiator_id = 7; /* XXX */
cpi->bus_id = sim->bus_id;
cpi->base_transfer_speed = 400 * 1000 / 8;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "SBP_TARG", HBA_IDLEN);
- strncpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "SBP_TARG", HBA_IDLEN);
+ strlcpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
cpi->unit_number = sim->unit_number;
cpi->ccb_h.status = CAM_REQ_CMP;
Modified: stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
==============================================================================
--- stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -934,9 +934,9 @@ static void hpt_action(struct cam_sim *s
cpi->initiator_id = osm_max_targets;
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
cpi->protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/hptiop/hptiop.c
==============================================================================
--- stable/10/sys/dev/hptiop/hptiop.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/hptiop/hptiop.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -2362,9 +2362,9 @@ scsi_done:
cpi->initiator_id = hba->max_devices;
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
cpi->protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/hptmv/entry.c
==============================================================================
--- stable/10/sys/dev/hptmv/entry.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/hptmv/entry.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -2417,9 +2417,9 @@ hpt_action(struct cam_sim *sim, union cc
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
Modified: stable/10/sys/dev/hptnr/hptnr_osm_bsd.c
==============================================================================
--- stable/10/sys/dev/hptnr/hptnr_osm_bsd.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/hptnr/hptnr_osm_bsd.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1134,9 +1134,9 @@ static void hpt_action(struct cam_sim *s
cpi->initiator_id = osm_max_targets;
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
cpi->protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/hptrr/hptrr_osm_bsd.c
==============================================================================
--- stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/hptrr/hptrr_osm_bsd.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -782,9 +782,9 @@ static void hpt_action(struct cam_sim *s
cpi->initiator_id = osm_max_targets;
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "HPT ", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
cpi->protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==============================================================================
--- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -266,10 +266,10 @@ static const struct hyperv_guid gBlkVscD
};
static struct storvsc_driver_props g_drv_props_table[] = {
- {"blkvsc", "Hyper-V IDE Storage Interface",
+ {"blkvsc", "Hyper-V IDE",
BLKVSC_MAX_IDE_DISKS_PER_TARGET, BLKVSC_MAX_IO_REQUESTS,
20*PAGE_SIZE},
- {"storvsc", "Hyper-V SCSI Storage Interface",
+ {"storvsc", "Hyper-V SCSI",
STORVSC_MAX_LUNS_PER_TARGET, STORVSC_MAX_IO_REQUESTS,
20*PAGE_SIZE}
};
@@ -1451,9 +1451,9 @@ storvsc_action(struct cam_sim *sim, unio
cpi->transport_version = 0;
cpi->protocol = PROTO_SCSI;
cpi->protocol_version = SCSI_REV_SPC2;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, sc->hs_drv_props->drv_name, HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, sc->hs_drv_props->drv_name, HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
ccb->ccb_h.status = CAM_REQ_CMP;
Modified: stable/10/sys/dev/iir/iir.c
==============================================================================
--- stable/10/sys/dev/iir/iir.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/iir/iir.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1366,12 +1366,12 @@ iir_action( struct cam_sim *sim, union c
cpi->initiator_id =
(bus == gdt->sc_virt_bus ? 127 : gdt->sc_bus_id[bus]);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
if (gdt->sc_vendor == INTEL_VENDOR_ID_IIR)
- strncpy(cpi->hba_vid, "Intel Corp.", HBA_IDLEN);
+ strlcpy(cpi->hba_vid, "Intel Corp.", HBA_IDLEN);
else
- strncpy(cpi->hba_vid, "ICP vortex ", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->hba_vid, "ICP vortex ", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
cpi->protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/isci/isci_controller.c
==============================================================================
--- stable/10/sys/dev/isci/isci_controller.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/isci/isci_controller.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -691,9 +691,9 @@ void isci_action(struct cam_sim *sim, un
cpi->bus_id = bus;
cpi->initiator_id = SCI_MAX_REMOTE_DEVICES;
cpi->base_transfer_speed = 300000;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Intel Corp.", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Intel Corp.", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->transport = XPORT_SAS;
cpi->transport_version = 0;
cpi->protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/iscsi_initiator/isc_cam.c
==============================================================================
--- stable/10/sys/dev/iscsi_initiator/isc_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/iscsi_initiator/isc_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -75,9 +75,9 @@ _inq(struct cam_sim *sim, union ccb *ccb
cpi->max_lun = sp->opt.maxluns - 1;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 3300; // 40000; // XXX:
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "iSCSI", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "iSCSI", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->ccb_h.status = CAM_REQ_CMP;
#if defined(KNOB_VALID_ADDRESS)
Modified: stable/10/sys/dev/isp/isp_freebsd.c
==============================================================================
--- stable/10/sys/dev/isp/isp_freebsd.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/isp/isp_freebsd.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -3921,9 +3921,9 @@ isp_action(struct cam_sim *sim, union cc
}
cpi->protocol = PROTO_SCSI;
cpi->protocol_version = SCSI_REV_2;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Qlogic", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Qlogic", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->ccb_h.status = CAM_REQ_CMP;
xpt_done(ccb);
Modified: stable/10/sys/dev/mfi/mfi_cam.c
==============================================================================
--- stable/10/sys/dev/mfi/mfi_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/mfi/mfi_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -223,9 +223,9 @@ mfip_cam_action(struct cam_sim *sim, uni
cpi->max_target = MFI_SCSI_MAX_TARGETS;
cpi->max_lun = MFI_SCSI_MAX_LUNS;
cpi->initiator_id = MFI_SCSI_INITIATOR_ID;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "LSI", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "LSI", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 150000;
Modified: stable/10/sys/dev/mly/mly.c
==============================================================================
--- stable/10/sys/dev/mly/mly.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/mly/mly.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -2076,9 +2076,9 @@ mly_cam_action(struct cam_sim *sim, unio
cpi->max_target = MLY_MAX_TARGETS - 1;
cpi->max_lun = MLY_MAX_LUNS - 1;
cpi->initiator_id = sc->mly_controllerparam->initiator_id;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "FreeBSD", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Mylex", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 132 * 1024; /* XXX what to set this to? */
Modified: stable/10/sys/dev/mpr/mpr_sas.c
==============================================================================
--- stable/10/sys/dev/mpr/mpr_sas.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/mpr/mpr_sas.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -987,9 +987,9 @@ mprsas_action(struct cam_sim *sim, union
cpi->max_target = sassc->maxtargets - 1;
cpi->max_lun = 255;
cpi->initiator_id = sassc->maxtargets - 1;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Avago Tech (LSI)", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Avago Tech", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
/*
Modified: stable/10/sys/dev/mps/mps_sas.c
==============================================================================
--- stable/10/sys/dev/mps/mps_sas.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/mps/mps_sas.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -943,9 +943,9 @@ mpssas_action(struct cam_sim *sim, union
cpi->max_target = sassc->maxtargets - 1;
cpi->max_lun = 255;
cpi->initiator_id = sassc->maxtargets - 1;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Avago Tech (LSI)", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Avago Tech", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 150000;
Modified: stable/10/sys/dev/mpt/mpt_cam.c
==============================================================================
--- stable/10/sys/dev/mpt/mpt_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/mpt/mpt_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -3583,9 +3583,9 @@ mpt_action(struct cam_sim *sim, union cc
} else {
cpi->target_sprt = 0;
}
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "LSI", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "LSI", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->ccb_h.status = CAM_REQ_CMP;
break;
Modified: stable/10/sys/dev/mrsas/mrsas_cam.c
==============================================================================
--- stable/10/sys/dev/mrsas/mrsas_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/mrsas/mrsas_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -356,9 +356,9 @@ mrsas_action(struct cam_sim *sim, union
ccb->cpi.bus_id = cam_sim_bus(sim);
ccb->cpi.initiator_id = MRSAS_SCSI_INITIATOR_ID;
ccb->cpi.base_transfer_speed = 150000;
- strncpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(ccb->cpi.hba_vid, "AVAGO", HBA_IDLEN);
- strncpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(ccb->cpi.hba_vid, "AVAGO", HBA_IDLEN);
+ strlcpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN);
ccb->cpi.transport = XPORT_SPI;
ccb->cpi.transport_version = 2;
ccb->cpi.protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/mvs/mvs.c
==============================================================================
--- stable/10/sys/dev/mvs/mvs.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/mvs/mvs.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -2412,9 +2412,9 @@ mvsaction(struct cam_sim *sim, union ccb
cpi->initiator_id = 0;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 150000;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Marvell", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Marvell", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SATA;
cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
Modified: stable/10/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
==============================================================================
--- stable/10/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1839,9 +1839,9 @@ static void agtiapi_cam_action( struct c
cpi->max_lun = AGTIAPI_MAX_LUN;
cpi->maxio = 1024 *1024; /* Max supported I/O size, in bytes. */
cpi->initiator_id = 255;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "PMC", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "PMC", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
// rate is set when XPT_GET_TRAN_SETTINGS is processed
Modified: stable/10/sys/dev/ppbus/vpo.c
==============================================================================
--- stable/10/sys/dev/ppbus/vpo.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/ppbus/vpo.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -390,9 +390,9 @@ vpo_action(struct cam_sim *sim, union cc
cpi->initiator_id = VP0_INITIATOR;
cpi->bus_id = sim->bus_id;
cpi->base_transfer_speed = 93;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Iomega", HBA_IDLEN);
- strncpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Iomega", HBA_IDLEN);
+ strlcpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
cpi->unit_number = sim->unit_number;
cpi->transport = XPORT_PPB;
cpi->transport_version = 0;
Modified: stable/10/sys/dev/siis/siis.c
==============================================================================
--- stable/10/sys/dev/siis/siis.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/siis/siis.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -1952,9 +1952,9 @@ siisaction(struct cam_sim *sim, union cc
cpi->initiator_id = 0;
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 150000;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "SIIS", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "SIIS", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->transport = XPORT_SATA;
cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
Modified: stable/10/sys/dev/sym/sym_hipd.c
==============================================================================
--- stable/10/sys/dev/sym/sym_hipd.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/sym/sym_hipd.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -8049,9 +8049,9 @@ static void sym_action2(struct cam_sim *
cpi->bus_id = cam_sim_bus(sim);
cpi->initiator_id = np->myaddr;
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Symbios", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Symbios", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/trm/trm.c
==============================================================================
--- stable/10/sys/dev/trm/trm.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/trm/trm.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -651,9 +651,9 @@ trm_action(struct cam_sim *psim, union c
cpi->initiator_id = pACB->AdaptSCSIID;
cpi->bus_id = cam_sim_bus(psim);
cpi->base_transfer_speed = 3300;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Tekram_TRM", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Tekram_TRM", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(psim);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
Modified: stable/10/sys/dev/twa/tw_osl_cam.c
==============================================================================
--- stable/10/sys/dev/twa/tw_osl_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/twa/tw_osl_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -422,9 +422,9 @@ twa_action(struct cam_sim *sim, union cc
path_inq->bus_id = cam_sim_bus(sim);
path_inq->initiator_id = TW_CL_MAX_NUM_UNITS;
path_inq->base_transfer_speed = 100000;
- strncpy(path_inq->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(path_inq->hba_vid, "3ware", HBA_IDLEN);
- strncpy(path_inq->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(path_inq->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(path_inq->hba_vid, "3ware", HBA_IDLEN);
+ strlcpy(path_inq->dev_name, cam_sim_name(sim), DEV_IDLEN);
path_inq->transport = XPORT_SPI;
path_inq->transport_version = 2;
path_inq->protocol = PROTO_SCSI;
Modified: stable/10/sys/dev/tws/tws_cam.c
==============================================================================
--- stable/10/sys/dev/tws/tws_cam.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/tws/tws_cam.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -309,9 +309,9 @@ tws_action(struct cam_sim *sim, union cc
ccb->cpi.bus_id = cam_sim_bus(sim);
ccb->cpi.initiator_id = TWS_SCSI_INITIATOR_ID;
ccb->cpi.base_transfer_speed = 6000000;
- strncpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(ccb->cpi.hba_vid, "3ware", HBA_IDLEN);
- strncpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(ccb->cpi.hba_vid, "3ware", HBA_IDLEN);
+ strlcpy(ccb->cpi.dev_name, cam_sim_name(sim), DEV_IDLEN);
#if (__FreeBSD_version >= 700000 )
ccb->cpi.transport = XPORT_SPI;
ccb->cpi.transport_version = 2;
Modified: stable/10/sys/dev/virtio/scsi/virtio_scsi.c
==============================================================================
--- stable/10/sys/dev/virtio/scsi/virtio_scsi.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/dev/virtio/scsi/virtio_scsi.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -917,9 +917,9 @@ vtscsi_cam_path_inquiry(struct vtscsi_so
cpi->max_lun = sc->vtscsi_max_lun;
cpi->initiator_id = VTSCSI_INITIATOR_ID;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "VirtIO", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "VirtIO", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
Modified: stable/10/sys/powerpc/ps3/ps3cdrom.c
==============================================================================
--- stable/10/sys/powerpc/ps3/ps3cdrom.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/powerpc/ps3/ps3cdrom.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -421,9 +421,9 @@ ps3cdrom_action(struct cam_sim *sim, uni
cpi->bus_id = cam_sim_bus(sim);
cpi->unit_number = cam_sim_unit(sim);
cpi->base_transfer_speed = 150000;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "Sony", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "Sony", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->transport = XPORT_SPI;
cpi->transport_version = 2;
cpi->protocol = PROTO_SCSI;
Modified: stable/10/sys/powerpc/pseries/phyp_vscsi.c
==============================================================================
--- stable/10/sys/powerpc/pseries/phyp_vscsi.c Thu Mar 23 06:40:20 2017 (r315812)
+++ stable/10/sys/powerpc/pseries/phyp_vscsi.c Thu Mar 23 06:41:13 2017 (r315813)
@@ -428,9 +428,9 @@ vscsi_cam_action(struct cam_sim *sim, un
cpi->max_target = 0;
cpi->max_lun = ~(lun_id_t)(0);
cpi->initiator_id = ~0;
- strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "IBM", HBA_IDLEN);
- strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+ strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+ strlcpy(cpi->hba_vid, "IBM", HBA_IDLEN);
+ strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
cpi->base_transfer_speed = 150000;
More information about the svn-src-stable-10
mailing list