Date: Tue, 17 Nov 2009 20:54:52 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r199436 - stable/8/sys/cam/scsi Message-ID: <200911172054.nAHKsqBi037900@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Nov 17 20:54:52 2009 New Revision: 199436 URL: http://svn.freebsd.org/changeset/base/199436 Log: MFC r198832: Provide the same sanity check on the sector size in dagetcapacity as when the disk is first probed. dagetcapacity is called whenever the disk is opened from geom via d_open(), a zero sector size will cause geom to panic later on. Modified: stable/8/sys/cam/scsi/scsi_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Tue Nov 17 20:49:26 2009 (r199435) +++ stable/8/sys/cam/scsi/scsi_da.c Tue Nov 17 20:54:52 2009 (r199436) @@ -1948,8 +1948,15 @@ dagetcapacity(struct cam_periph *periph) done: - if (error == 0) - dasetgeom(periph, block_len, maxsector); + if (error == 0) { + if (block_len >= MAXPHYS || block_len == 0) { + xpt_print(periph->path, + "unsupportable block size %ju\n", + (uintmax_t) block_len); + error = EINVAL; + } else + dasetgeom(periph, block_len, maxsector); + } xpt_release_ccb(ccb);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911172054.nAHKsqBi037900>