svn commit: r251670 - stable/9/sys/dev/mps
Alan Somers
asomers at FreeBSD.org
Wed Jun 12 22:19:51 UTC 2013
Author: asomers
Date: Wed Jun 12 22:19:49 2013
New Revision: 251670
URL: http://svnweb.freebsd.org/changeset/base/251670
Log:
MFC r251396
sys/dev/mps/mps.c
sys/dev/mps/mps_user.c
Fix uninitialized memory reference in mps_read_config_page. It was
referencing a field (params->hdr.Ext.ExtPageType) that would only be
set when reading an Extended config page. The symptom was that
MPSIO_READ_CFG_PAGE ioctls would randomly fail with
MPI2_IOCSTATUS_CONFIG_INVALID_PAGE errors. The solution is to
determine whether an extended or an ordinary config page is requested
by looking at the PageType field, which should be available regardless.
Similarly, mps_user_read_extcfg_header and mps_user_read_extcfg_page,
which call mps_read_config_page, had to be fixed to always set the
PageType field. They were implicitly assuming that
mps_read_config_page always operated on Extended pages.
Reviewed by: ken
Approved by: ken (mentor)
Modified:
stable/9/sys/dev/mps/mps.c
stable/9/sys/dev/mps/mps_user.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/dev/ (props changed)
Modified: stable/9/sys/dev/mps/mps.c
==============================================================================
--- stable/9/sys/dev/mps/mps.c Wed Jun 12 21:41:09 2013 (r251669)
+++ stable/9/sys/dev/mps/mps.c Wed Jun 12 22:19:49 2013 (r251670)
@@ -2409,7 +2409,7 @@ mps_read_config_page(struct mps_softc *s
req->SGLFlags = 0;
req->ChainOffset = 0;
req->PageAddress = params->page_address;
- if (params->hdr.Ext.ExtPageType != 0) {
+ if (params->hdr.Struct.PageType == MPI2_CONFIG_PAGETYPE_EXTENDED) {
MPI2_CONFIG_EXTENDED_PAGE_HEADER *hdr;
hdr = ¶ms->hdr.Ext;
Modified: stable/9/sys/dev/mps/mps_user.c
==============================================================================
--- stable/9/sys/dev/mps/mps_user.c Wed Jun 12 21:41:09 2013 (r251669)
+++ stable/9/sys/dev/mps/mps_user.c Wed Jun 12 22:19:49 2013 (r251670)
@@ -305,6 +305,7 @@ mps_user_read_extcfg_header(struct mps_s
hdr = ¶ms.hdr.Ext;
params.action = MPI2_CONFIG_ACTION_PAGE_HEADER;
hdr->PageVersion = ext_page_req->header.PageVersion;
+ hdr->PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
hdr->ExtPageLength = 0;
hdr->PageNumber = ext_page_req->header.PageNumber;
hdr->ExtPageType = ext_page_req->header.ExtPageType;
@@ -346,6 +347,7 @@ mps_user_read_extcfg_page(struct mps_sof
params.action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
params.page_address = le32toh(ext_page_req->page_address);
hdr->PageVersion = reqhdr->PageVersion;
+ hdr->PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
hdr->PageNumber = reqhdr->PageNumber;
hdr->ExtPageType = reqhdr->ExtPageType;
hdr->ExtPageLength = reqhdr->ExtPageLength;
More information about the svn-src-stable-9
mailing list