summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-05-20 00:33:54 +0000
committermav <mav@FreeBSD.org>2013-05-20 00:33:54 +0000
commitda1d4b7e77246f92792d33f8b31ed07cf2a475fb (patch)
treecbf873bb3d93c85f05e2a2ec575c99c86ca3a11b /sys/geom
parent3df7f9c0a102ccf91f92902098cf98eac861a01a (diff)
downloadFreeBSD-src-da1d4b7e77246f92792d33f8b31ed07cf2a475fb.zip
FreeBSD-src-da1d4b7e77246f92792d33f8b31ed07cf2a475fb.tar.gz
Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit.
In some cases it could cause kernel panic during failed drive replacement. Reported by: trasz MFC after: 1 week
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/raid/md_ddf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/raid/md_ddf.c b/sys/geom/raid/md_ddf.c
index c18a319..5a17301 100644
--- a/sys/geom/raid/md_ddf.c
+++ b/sys/geom/raid/md_ddf.c
@@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta *vmeta, uint32_t PD_Reference,
int i, bvd, pos;
i = 0;
- for (bvd = 0; bvd < GET16(vmeta, vdc->Secondary_Element_Count); bvd++) {
+ for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) {
if (vmeta->bvdc[bvd] == NULL) {
i += GET16(vmeta, vdc->Primary_Element_Count); // XXX
continue;
OpenPOWER on IntegriCloud