aboutsummaryrefslogtreecommitdiffstats
path: root/sys/cam/nvme
diff options
context:
space:
mode:
authorDavid Bright <dab@FreeBSD.org>2020-03-23 12:38:44 +0000
committerDavid Bright <dab@FreeBSD.org>2020-03-23 12:38:44 +0000
commitd50a677347c4776ccd2ea428b0a9c0955a92e3b8 (patch)
treeec25021095de3751c2d69839ef9fd2426964a3d7 /sys/cam/nvme
parent42b210a73492779d20a76aa0f6d7d9a2a5567536 (diff)
downloadsrc-d50a677347c4776ccd2ea428b0a9c0955a92e3b8.tar.gz
src-d50a677347c4776ccd2ea428b0a9c0955a92e3b8.zip
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
Notes
Notes: svn path=/stable/12/; revision=359236
Diffstat (limited to 'sys/cam/nvme')
-rw-r--r--sys/cam/nvme/nvme_da.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index 6366fb1325d7..d382a4d9ce98 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -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;