NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/41704: configuring cgd1 makes bogus access on cgd0



>Number:         41704
>Category:       kern
>Synopsis:       configuring cgd1 causes read to be attempted on cgd0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 12 13:35:00 +0000 2009
>Originator:     Christoph Badura
>Release:        NetBSD 5.0_STABLE as of 2009-07-02
>Organization:
netbsd bozotic software test labs
        
>Environment:
        
        
System: NetBSD sanctioned-parts-list 5.0_STABLE NetBSD 5.0_STABLE (GENERIC) #0: 
Thu Jul 2 18:47:45 UTC 2009 
root@arbitrary:/m/obj/m/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
        
I have a system with 2 cgds configured on two raidframe RAID 1 devices on 2
9GB and two 50GB SCSI disks.
When going multi-user the kernel complains
cgd0: error 22
when configuring the cgds.

This can be trace to configuring cgd1.  E.g. boot single-user, configure the
raids and configure the cgds:

# cgdconfig cgd0 /dev/raid0e
# cgdconfig cgd1 /dev/raid1a
cgd0: error 22
# cgdconfig -u cgd1
# cgdconfig cgd1 /dev/raid1a
cgd0: error 22

etc. ad nauseam.

Running a kernel compiled with CGDDEBUG and cgddebug set to 3 reveals the
following bogus read:

cgd_cipher() dir=1
getcgd_softc(0x3): unit = 0
cgdstrategy(0xc32a9570): b_bcount = 512
cgdstart(0xc31bb400, 0xc32a9570)
getcgd_softc(0x3): unit = 0
cgdiodone(0xc3127ec8)
cgdiodone: bp 0xc32a9570 bcount 512 resid 512
 dev 0x1204, nbp 0xc3127ec8 bn 97693565 addr 0xcd73fc00 bcnt 512
cgd0: error 22

Note that the block number of the request is the last block of the raid1a
partition on which cgd1 is created.

For reference the relevant disktab entries:

hp9.1g|HP9.1G oemed IBM DDYS 9GB disk:\
        :ty=winchester:dt=SCSI:\
        :se#512:ns#392:nt#3:sc#1176:nc#15110:\
        :su#17773524:rm#10000:\
        :pd#17773524:od#0:
st150176|SEAGATE ST150176LC:\
        :ty=winchester:dt=SCSI:\
        :se#512:ns#369:nt#22:sc#8118:nc#12024:\
        :su#97693755:rm#7200:\
        :pd#97693755:od#0:
hp9.1g-boot|HP9.1G boot disk with large RAID partition:\
        :pc#17773461:oc#63:\
        :pa#17248329:oa#63:ta=RAID:\
        :pb#525132:ob#17248392:tb=swap:\
        :tc=hp9.1g:
hp9.1g-boot-raid|boot raid with root fs and large CGD partition:\
        :dt=RAID:se#512:ns#128:nt#8:sc#1024:nc#16845:\
        :su#17248256:rm#10000:\
        :pd#17248256:od#0:\
        :pc#17248256:oc#0:\
        :pa#262144:oa#0:ta=4.2BSD:ba#8192:fa#1024:\
        :pe#16986112:oe#262144:te=ccd:
hp9.1g-boot-cgd|cgd partiton on hp9.1g-boot-raid:\
        :dt=cgd:se#512:ns#2048:nt#1:sc#2048:nc#8294:\
        :su#16986112:rm#10000:\
        :pd#16986112:od#0:\
        :pc#16986112:oc#0:\
        :pa#2097152:oa#0:ta=4.2BSD:ba#8192:fa#1024:\
        :pe#1048576:oe#2097152:te=4.2BSD:be#8192:fe#1024:\
        :pf#13840384:of#3145728:tf=4.2BSD:bf#8192:ff#1024:
seagate50g-app|SEAGATE ST150176LC application disk:\
        :pc#97693755:oc#0:\
        :pa#97693755:oa#0:ta=RAID:\
        :tc=st150176:
seagate50g-app-raid|raid partition on seagate50g-app:\
        :dt=RAID:se#512:ns#128:nt#8:sc#1024:nc#95404:\
        :su#97693568:rm#7200:\
        :pd#97693568:od#0:\
        :pa#97693566:oa#2:ta=ccd:
seagate50g-app-cgd|cgd partition on seagate50g-app-raid:\
        :dt=cgd:se#512:ns#2048:nt#1:sc#2048:nc#47936:\
        :su#97693566:rm#7200:\
        :pd#97693566:od#0:\
        :pa#97693564:oa#2:ta=4.2BSD:ba#16384:fa#2048:

And example cgd config files:

/etc/cgd/cgd.conf:
cgd0 /dev/raid0e
cgd1 /dev/raid1a

/etc/cgd/raid0e:
algorithm aes-cbc;
iv-method encblkno1;
keylength 128;
verify_method disklabel;
keygen storedkey key hogehogehogehoge;

/etc/cgd/raid1a:
algorithm aes-cbc;
iv-method encblkno1;
keylength 128;
verify_method disklabel;
keygen storedkey key mogamogamogamoga;

>How-To-Repeat:
        

configure two cgds c.f. above and run
cgdconfig cgd0 /dev/raid0e
cgdconfig cgd1 /dev/raid1a

>Fix:
        
Unknown.

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index