svn commit: r272621 - stable/10/sys/cam/ctl
Alexander Motin
mav at FreeBSD.org
Mon Oct 6 12:40:16 UTC 2014
Author: mav
Date: Mon Oct 6 12:40:15 2014
New Revision: 272621
URL: https://svnweb.freebsd.org/changeset/base/272621
Log:
MFC r271354: Fix couple off-by-one range check errors, reported by Coverity.
Modified:
stable/10/sys/cam/ctl/ctl.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cam/ctl/ctl.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl.c Mon Oct 6 12:39:25 2014 (r272620)
+++ stable/10/sys/cam/ctl/ctl.c Mon Oct 6 12:40:15 2014 (r272621)
@@ -2545,7 +2545,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd,
mtx_lock(&softc->ctl_lock);
if (((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0)
- && ((ooa_hdr->lun_num > CTL_MAX_LUNS)
+ && ((ooa_hdr->lun_num >= CTL_MAX_LUNS)
|| (softc->ctl_luns[ooa_hdr->lun_num] == NULL))) {
mtx_unlock(&softc->ctl_lock);
free(entries, M_CTL);
@@ -2740,7 +2740,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd,
#ifdef CTL_IO_DELAY
mtx_lock(&softc->ctl_lock);
- if ((delay_info->lun_id > CTL_MAX_LUNS)
+ if ((delay_info->lun_id >= CTL_MAX_LUNS)
|| (softc->ctl_luns[delay_info->lun_id] == NULL)) {
delay_info->status = CTL_DELAY_STATUS_INVALID_LUN;
} else {
More information about the svn-src-stable-10
mailing list