/
/
先下断点
3
: kd>bp vmbusr!XPartDeref; ba w1 rcx
+
88
" r;k;r $t1=rcx+3b8;r $t2=$t1; dc $t2-3b8+88;r $t1=poi($t1); .for(r $t3=0;$t1 > $t2 or $t1 < $t2;r $t3=$t3+1){r $t1=poi($t1); };.printf \"%p Channel count %p\r\n\",$t2-3b8+88, $t3;gc"
/
/
正常析构时分区引用次数为通道的数量
*
2
次引用次数数加上分区本身的一次引用
1e
=
e
*
2
+
1
+
1
rax
=
ffffe60151627928 rbx
=
ffffe60151627850 rcx
=
000000000000001d
rdx
=
ffffe60151627928 rsi
=
ffffe6014ff9c0e8 rdi
=
ffffe6015125a000
rip
=
fffff8033e0b1a76 rsp
=
ffffbb0f55517200 rbp
=
0000000000000000
r8
=
fffff8033e0c6780 r9
=
ffffe60151627928 r10
=
fffff8033e0b1a20
r11
=
0000000000000000
r12
=
ffffe6012e9f43b0 r13
=
ffffe6012ff8d000
r14
=
fffff8033e0b1a20 r15
=
fffff80322403980
iopl
=
0
nv up ei pl nz na po nc
cs
=
0010
ss
=
0018
ds
=
002b
es
=
002b
fs
=
0053
gs
=
002b
efl
=
00040206
vmbusr!ChDestroyChannelWorkItem
+
0x56
:
fffff803`
3e0b1a76
48ffc1
inc rcx
00
ffffbb0f`
55517200
fffff803`
22403a80
vmbusr!ChDestroyChannelWorkItem
+
0x56
01
ffffbb0f`
55517250
fffff803`
22552315
nt!IopProcessWorkItem
+
0x100
02
ffffbb0f`
555172c0
fffff803`
22554d07
nt!ExpWorkerThread
+
0x155
03
ffffbb0f`
555174b0
fffff803`
2261ae24
nt!PspSystemThreadStartup
+
0x57
04
ffffbb0f`
55517500
00000000
`
00000000
nt!KiStartSystemThread
+
0x34
/
/
分区引用计数
ffffe601`
5125a088
0000001e
00000000
00050000
00050003
................
ffffe601`
5125a098
00000000
00000000
00000000
00000000
................
ffffe601`
5125a0a8
00000000
00000000
b0cad258
000019fe
........X.......
ffffe601`
5125a0b8
4fae8000
ffffe601
4ff8fd60
ffffe601 ...O....`..O....
ffffe601`
5125a0c8
00020101
000002e0
00000000
00000000
................
ffffe601`
5125a0d8
00000000
00000000
4ea30000
ffffe601 ...........N....
ffffe601`
5125a0e8
00000000
00000000
00000000
00000000
................
ffffe601`
5125a0f8
00000000
00000000
00000000
00000000
................
/
/
通道引用计数
ffffe6015125a088 Channel count
000000000000000e
/
/
虚拟机重置后引用次数比正常少了
1
rdx
=
0000000000000001
rsi
=
ffffe6014ea30000 rdi
=
0000000000000000
rip
=
fffff8033e0b7795 rsp
=
ffffbb0f5a82ee30 rbp
=
0000000000000000
r8
=
ffffe6014e9c419c r9
=
0000000000000014
r10
=
fffff8032245e560
r11
=
00000000000099b0
r12
=
0000000000000000
r13
=
0000000000000000
r14
=
ffffe6014e967b48 r15
=
ffffe601516760f0
iopl
=
0
nv up ei pl nz ac po cy
cs
=
0010
ss
=
0018
ds
=
002b
es
=
002b
fs
=
0053
gs
=
002b
efl
=
00040217
vmbusr!XPartDeref
+
0x11
:
fffff803`
3e0b7795
4883e801
sub rax,
1
00
ffffbb0f`
5a82ee30
fffff803`
3e0b888b
vmbusr!XPartDeref
+
0x11
01
ffffbb0f`
5a82ee60
fffff803`
3e0d7f62
vmbusr!XPartRemovePartition
+
0x1bb
02
ffffbb0f`
5a82eec0
fffff803`
3e0d6bb7
vmbusr!ChResetPartition
+
0x5e
03
ffffbb0f`
5a82eef0
fffff803`
3e0aea6a
vmbusr!RootIoctlVdevReset
+
0xe3
04
ffffbb0f`
5a82ef30
fffff803`
26dfe7b8
vmbusr!RootIoctlDeviceControlPreprocess
+
0xea
05
ffffbb0f`
5a82ef60
ffffe601`
4dc4fb20
0xfffff803
`
26dfe7b8
06
ffffbb0f`
5a82ef68
00000000
`
0000000e
0xffffe601
`
4dc4fb20
/
/
分区引用计数
ffffe601`
5125a088
0000001d
00000000
00050000
00050003
................
ffffe601`
5125a098
00000000
00000000
00000000
00000000
................
ffffe601`
5125a0a8
00000000
00000000
b0cad258
000019fe
........X.......
ffffe601`
5125a0b8
4fae8000
ffffe601
4ff8fd60
ffffe601 ...O....`..O....
ffffe601`
5125a0c8
00020101
000002e0
00000000
00000000
................
ffffe601`
5125a0d8
00000000
00000000
4ea30000
ffffe601 ...........N....
ffffe601`
5125a0e8
00000000
00000000
00000000
00000000
................
ffffe601`
5125a0f8
00000000
00000000
00000000
00000000
................
/
/
通道引用计数
ffffe6015125a088 Channel count
000000000000000e
/
/
虚拟机关闭
rdx
=
ffffe601513a9701 rsi
=
ffffe6014ea30000 rdi
=
0000000000000000
rip
=
fffff8033e0b7795 rsp
=
ffffbb0f56f76dc0 rbp
=
ffffe6014e967a00
r8
=
000000000000054b
r9
=
0000000000000000
r10
=
fffff8032245e560
r11
=
000000000000a5b0
r12
=
fffff8033e0c2100 r13
=
0000000000000000
r14
=
0000000000000000
r15
=
ffffe60147a57760
iopl
=
0
nv up ei pl nz na po cy
cs
=
0010
ss
=
0018
ds
=
002b
es
=
002b
fs
=
0053
gs
=
002b
efl
=
00040207
vmbusr!XPartDeref
+
0x11
:
fffff803`
3e0b7795
4883e801
sub rax,
1
00
ffffbb0f`
56f76dc0
fffff803`
3e0b888b
vmbusr!XPartDeref
+
0x11
01
ffffbb0f`
56f76df0
fffff803`
3e0b9073
vmbusr!XPartRemovePartition
+
0x1bb
02
ffffbb0f`
56f76e50
fffff803`
3e0b8843
vmbusr!ParentCleanupPartition
+
0x73
03
ffffbb0f`
56f76e80
fffff803`
3e0d69c1
vmbusr!XPartRemovePartition
+
0x173
04
ffffbb0f`
56f76ee0
fffff803`
3e0aea4d
vmbusr!RootIoctlVdevPowerOff
+
0x12d
05
ffffbb0f`
56f76f30
fffff803`
26dfe7b8
vmbusr!RootIoctlDeviceControlPreprocess
+
0xcd
06
ffffbb0f`
56f76f60
ffffe601`
4ed13de0
0xfffff803
`
26dfe7b8
07
ffffbb0f`
56f76f68
00000000
`
0000000e
0xffffe601
`
4ed13de0
/
/
分区引用计数
ffffe601`
5125a088
00000010
00000000
00050000
00050003
................
ffffe601`
5125a098
00000000
00000000
00000000
00000000
................
ffffe601`
5125a0a8
00000000
00000000
b0cad258
000019fe
........X.......
ffffe601`
5125a0b8
4fae8000
ffffe601
4ff8fd60
ffffe601 ...O....`..O....
ffffe601`
5125a0c8
00020101
000002e0
00000000
00000000
................
ffffe601`
5125a0d8
00000000
00000000
4ea30000
ffffe601 ...........N....
ffffe601`
5125a0e8
00000000
00000000
00000000
00000000
................
ffffe601`
5125a0f8
00000000
00000000
00000000
00000000
................
/
/
通道引用计数
ffffe6015125a088 Channel count
0000000000000008
/
/
导致最后的引引用次数会变成负数
-
1
rax
=
0000000000000000
rbx
=
ffffe6014e213960 rcx
=
ffffe6015125a000
rdx
=
0000000000000000
rsi
=
0000000000000000
rdi
=
ffffe6015125a000
rip
=
fffff8033e0b7795 rsp
=
ffffbb0f555171d0 rbp
=
0000000000000000
r8
=
0000000000000000
r9
=
7ffffffffffffffc
r10
=
fffff80322462170
r11
=
ffffe6014e213950 r12
=
ffffe6012e9f43b0 r13
=
ffffe6012ff8d000
r14
=
0000000000000000
r15
=
0000000000000000
iopl
=
0
nv up ei ng nz na po nc
cs
=
0010
ss
=
0018
ds
=
002b
es
=
002b
fs
=
0053
gs
=
002b
efl
=
00040286
vmbusr!XPartDeref
+
0x11
:
fffff803`
3e0b7795
4883e801
sub rax,
1
00
ffffbb0f`
555171d0
fffff803`
3e0b1b8c
vmbusr!XPartDeref
+
0x11
01
ffffbb0f`
55517200
fffff803`
22403a80
vmbusr!ChDestroyChannelWorkItem
+
0x16c
02
ffffbb0f`
55517250
fffff803`
22552315
nt!IopProcessWorkItem
+
0x100
03
ffffbb0f`
555172c0
fffff803`
22554d07
nt!ExpWorkerThread
+
0x155
04
ffffbb0f`
555174b0
fffff803`
2261ae24
nt!PspSystemThreadStartup
+
0x57
05
ffffbb0f`
55517500
00000000
`
00000000
nt!KiStartSystemThread
+
0x34
/
/
分区引用计数
ffffe601`
5125a088
ffffffff ffffffff
00050000
00050003
................
ffffe601`
5125a098
00000000
00000000
00000000
00000000
................
ffffe601`
5125a0a8
00000000
00000000
b0cad258
000019fe
........X.......
ffffe601`
5125a0b8
4fae8000
ffffe601
4ff8fd60
ffffe601 ...O....`..O....
ffffe601`
5125a0c8
00020101
000002e0
00000000
00000000
................
ffffe601`
5125a0d8
00000000
00000000
4ea30000
ffffe601 ...........N....
ffffe601`
5125a0e8
00000000
00000000
00000000
00000000
................
ffffe601`
5125a0f8
00000000
00000000
00000000
00000000
................
/
/
通道引用计数
ffffe6015125a088 Channel count
0000000000000000
/
/
bsod
rax
=
ffffffffffffffff rbx
=
0000000000000000
rcx
=
000000000000000e
rdx
=
0000000000000000
rsi
=
0000000000000000
rdi
=
0000000000000000
rip
=
fffff8033e0b77a5 rsp
=
ffffbb0f555171d0 rbp
=
0000000000000000
r8
=
0000000000000000
r9
=
7ffffffffffffffc
r10
=
fffff80322462170
r11
=
ffffe6014e213950 r12
=
0000000000000000
r13
=
0000000000000000
r14
=
0000000000000000
r15
=
0000000000000000
iopl
=
0
nv up ei ng nz na po nc
vmbusr!XPartDeref
+
0x21
:
fffff803`
3e0b77a5
cd29
int
29h
Resetting default scope
EXCEPTION_RECORD: ffffbb0f55516f98
-
-
(.exr
0xffffbb0f55516f98
)
ExceptionAddress: fffff8033e0b77a5 (vmbusr!XPartDeref
+
0x0000000000000021
)
ExceptionCode: c0000409 (Security check failure
or
stack
buffer
overrun)
ExceptionFlags:
00000001
NumberParameters:
1
Parameter[
0
]:
000000000000000e
Subcode:
0xe
FAST_FAIL_INVALID_REFERENCE_COUNT
PROCESS_NAME: System
ERROR_CODE: (NTSTATUS)
0xc0000409
-
<Unable to get error code text>
EXCEPTION_CODE_STR: c0000409
EXCEPTION_PARAMETER1:
000000000000000e
EXCEPTION_STR:
0xc0000409
STACK_TEXT:
ffffbb0f`
55516508
fffff803`
22767092
: ffffbb0f`
55516670
fffff803`
224bdda0
ffff9781`
82511180
00000000
`
00000001
: nt!DbgBreakPointWithStatus
ffffbb0f`
55516510
fffff803`
22766753
: ffff9781`
00000003
ffffbb0f`
55516670
fffff803`
2262fd20
00000000
`
00000139
: nt!KiBugCheckDebugBreak
+
0x12
ffffbb0f`
55516570
fffff803`
22615db7
: ffffe601`
2b0ff040
00000000
`
00000000
ffffe601`
4e213960
00000000
`
00000000
: nt!KeBugCheck2
+
0xba3
ffffbb0f`
55516ce0
fffff803`
2262bc29
:
00000000
`
00000139
00000000
`
0000000e
ffffbb0f`
55517040
ffffbb0f`
55516f98
: nt!KeBugCheckEx
+
0x107
ffffbb0f`
55516d20
fffff803`
2262c1f2
:
00000000
`
00000000
00000000
`
00000000
00000000
`
00000000
00000000
`
00000000
: nt!KiBugCheckDispatch
+
0x69
ffffbb0f`
55516e60
fffff803`
22629edb
:
00000000
`
00040246
fffff803`
2253f0b3
00000000
`
0000000c
ffffe601`
2e5f1180
: nt!KiFastFailDispatch
+
0xb2
ffffbb0f`
55517040
fffff803`
3e0b77a5
: ffffe601`
4e213960
ffffe601`
4e213960
00000000
`
00000002
00000000
`
00000680
: nt!KiRaiseSecurityCheckFailure
+
0x35b
ffffbb0f`
555171d0
fffff803`
3e0b1b8c
: ffffe601`
4e213960
ffffe601`
2b0c94a0
fffff803`
22403980
fffff803`
3e0b1a20
: vmbusr!XPartDeref
+
0x21
ffffbb0f`
55517200
fffff803`
22403a80
: ffffe601`
2e9f43b0
00000000
`
00000000
ffffe601`
47a58450
00000000
`
00000000
: vmbusr!ChDestroyChannelWorkItem
+
0x16c
ffffbb0f`
55517250
fffff803`
22552315
: ffffe601`
2b0c94a0
ffffe601`
2ff8c040
ffffbb0f`
555173c0
00020000
`
00000000
: nt!IopProcessWorkItem
+
0x100
ffffbb0f`
555172c0
fffff803`
22554d07
: ffffe601`
2ff8c040
00000000
`
000000d8
ffffe601`
2ff8c040
fffff803`
225521c0
: nt!ExpWorkerThread
+
0x155
ffffbb0f`
555174b0
fffff803`
2261ae24
: ffff9781`
82511180
ffffe601`
2ff8c040
fffff803`
22554cb0
11ef5c6a
`
588718e0
: nt!PspSystemThreadStartup
+
0x57
ffffbb0f`
55517500
00000000
`
00000000
: ffffbb0f`
55518000
ffffbb0f`
55511000
00000000
`
00000000
00000000
`
00000000
: nt!KiStartSystemThread
+
0x34