最近Win10比较火的一个蓝屏bug,谷歌浏览器输入\\.\globalroot\device\condrv\kernelconnect,就会导致电脑输入出现如下图所示蓝屏。好奇心突发,于是尝试用ie浏览器,却不会触发蓝屏。到底为什么呢?开始分析

内核完整转储,然后Windbg分析一下

可以看到在condrv驱动里的派遣函数CdpDispatchCleanup发生了空指针引用,而后触发了蓝屏。

查看栈调用,发现谷歌浏览器调用了GetFileAttributesExW函数,然后转入ntdll,接着走进了内核,然后调用了condrv的派遣函数。

将C:\Windows\System32\drivers\condrv.sys拖入IDA,查看函数,经过对应发现是走到如上图所示的代码,触发了蓝屏异常。

接下来是动态调试google浏览器,在KERNELBASE.GetFileAttributesExW下断点。看看传了哪些参数。

由此可以写代码复现了。rcx,rdx,r8三个参数。
[C++] 纯文本查看 复制代码
01 02 03 04 05 06 07 08 09 10 11 12 | // BSOD.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include <Windows.h> int main() { WCHAR fileName[] = L "\\\\.\\globalroot\\device\\condrv\\kernelconnect" ; WIN32_FILE_ATTRIBUTE_DATA data; GetFileAttributesEx(fileName, GetFileExInfoStandard, &data); } |