svn commit: r359236 - stable/12/sys/cam/nvme

David Bright dab at FreeBSD.org
Mon Mar 23 12:38:44 UTC 2020


Author: dab
Date: Mon Mar 23 12:38:44 2020
New Revision: 359236
URL: https://svnweb.freebsd.org/changeset/base/359236

Log:
  MFC r359129:
  
  Fix parameter reversal potentially causing buffer overrun.
  
  Two arguments were reversed in calls to cam_strvis() in
  nvme_da.c. This was found by a Coverity scan of this code within Dell
  (Isilon). These are also marked in the FreeBSD Coverity scan as CIDs
  1400526 & 1400531.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  stable/12/sys/cam/nvme/nvme_da.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/nvme/nvme_da.c
==============================================================================
--- stable/12/sys/cam/nvme/nvme_da.c	Mon Mar 23 12:21:32 2020	(r359235)
+++ stable/12/sys/cam/nvme/nvme_da.c	Mon Mar 23 12:38:44 2020	(r359236)
@@ -798,9 +798,9 @@ ndaregister(struct cam_periph *periph, void *arg)
 	 *  the serial or model number strings.
 	 */
 	cam_strvis(disk->d_descr, cd->mn,
-	    sizeof(disk->d_descr), NVME_MODEL_NUMBER_LENGTH);
+	    NVME_MODEL_NUMBER_LENGTH, sizeof(disk->d_descr));
 	cam_strvis(disk->d_ident, cd->sn,
-	    sizeof(disk->d_ident), NVME_SERIAL_NUMBER_LENGTH);
+	    NVME_SERIAL_NUMBER_LENGTH, sizeof(disk->d_ident));
 	disk->d_hba_vendor = cpi.hba_vendor;
 	disk->d_hba_device = cpi.hba_device;
 	disk->d_hba_subvendor = cpi.hba_subvendor;


More information about the svn-src-all mailing list