Repository navigation
【bug】Windows:工作区的 Low 完整性标签打在 DSH 自身二进制上时,桌面端无法启动、插件安装必然 EPERM(安装目录 == 工作区) #9560
Replies: 1 comment
|
This is the other face of the mechanism reported in #9559 thirty minutes before your post, and the reason it bites is structural: the grant is standing. 1. Why the standing label reaches the host's own binary. The write grant materializes the Low label on the workspace root as an inheritable ACE ( 2. The repository-side gap. The sandbox has exactly this class of protection for one directory and not for this one. 3. What your evidence pins down. The write table is a good discriminator: 4. Where the fix belongs. Also core, and there are two directions for the maintainers to weigh: refuse the configuration the way the temp-root case is refused (a workspace that contains the harness installation), or exclude the harness's own tree from the label. Your workaround ( 5. From this side. Thanks for the four-way write matrix and the two |
Uh oh!
There was an error while loading. Please reload this page.
Summary (EN):
@deepseek-ai/dsh-sandbox-windows-aclstampsLowmandatory integrity on the workspace tree. When the install directory is itself the workspace, that stamp lands on DSH's ownDeepSeek Harness.exe. Windows then forces every process launched from that image to Low integrity, so the desktop client cannot start (Chromium singleton lock →ACCESS_DENIED 0x5), and plugin installation always fails with EPERM (pnpmcannot write%USERPROFILE%\.dsh\profiles\<profile>). Raising the tree back to Medium (icacls /setintegritylevel (OI)(CI)Medium /T) restores both.环境
0.2.0-rc.2(Windows x64,Electron)D:\dshD:\dsh(与安装目录相同)DSH_HOMEC:\Users\<user>\.dshdesktop摘要
一次正常的沙箱初始化,可以让 DSH 把自己锁死在「无法启动 + 无法安装插件」的状态。
工作区被打上
Low强制完整性标签后,因为安装目录就是工作区,这个标签同时落在 DSH 自己的二进制上。于是:Low标签的映像启动的进程整体被降为 Low,写不了隐式 Medium 的 userData 目录,Chromium 单例锁创建失败,秒退;pnpm子进程同样是 Low,写不了同样位于 C 盘用户目录的 profile。现象 A:应用无法启动
启动约 15 秒后退出,没有新的崩溃日志(在 Chromium 初始化早期就退出)。早期日志:
排查过程中确认过:userData 目录权限正常、目录里没有残留锁文件、我们自己写该目录完全正常,但只有 DSH 进程被拒。全新临时
--user-data-dir也一样,说明不是某个目录的问题。现象 B:插件安装 EPERM
在桌面客户端的「插件」页面安装
dsh-whale-widget:命令行同样失败,说明与插件页面无关(顺带确认:
dsh plugin --profile desktop …不会被profile "desktop" is managed exclusively by the Electron application拦下,它一路走到文件锁):根因
工作区树带
Low强制完整性标签:因为
D:\dsh既是安装目录又是工作区,DSH 自己的二进制继承了同一个标签:于是从它启动的进程被整体降为 Low(实测):
Low 进程受 no-write-up 约束,不能写 Medium 对象。而 userData(
%APPDATA%\@deepseek-ai\dsh-desktop)和 profile(%USERPROFILE%\.dsh\profiles\desktop)都是隐式 Medium:关键点:DACL 完全正常(
Administrator:(F)、无 deny 项、目录无只读属性、所有者正常),拒绝 100% 来自完整性级别。这也是排查时最容易走偏的地方——很容易误判成「杀软拦截」或「文件被瞬时占用」。同一个机制还解释了为什么「宿主进程能写、子进程不能写」:宿主是 Medium,而 shell /
pnpm子进程是 Low。临时修复(已验证)
把安装目录树提升回 Medium:
前后对比(同一台机器、同一会话):
whoami /groups)Low(S-1-16-4096)Medium(S-1-16-8192)%USERPROFILE%\.dsh%USERPROFILE%\.dsh\profiles\desktopAppData\Local\pnpmD:\devdsh plugin --profile desktop add dsh-whale-widget插件随后正常安装并加载(
dsh.profile.bundles追加成功,/dsh-whale/*路由注册成功)。建议修复
Low完整性标签施加到承载 DSH 自身二进制的目录上。 让受限子进程能写入工作区,单靠 ACL 授权(S-1-4-…写 ACE)就够了;Low标签是进程级降级,副作用会传染给从该目录启动的任何映像——包括 DSH 自己。这是本报告与 [Bug Report] windows-acl: Low integrity label (and allow ACE) not applied to existing subfolders, so the confined child can write only the workspace root #9559 的关键区别:[Bug Report] windows-acl: Low integrity label (and allow ACE) not applied to existing subfolders, so the confined child can write only the workspace root #9559 是「少写一个目录」,这里是「应用启动不了」。Low标签,跳过安装目录:比较工作区与被执行映像所在目录(process.execPath)即可判断;至少应在启动时检测「自身 exe 带 Low 标签」并给出明确诊断,而不是静默秒退。pnpm不应被沙箱降级,或应对 profile 目录做与工作区同等的沙箱授权。profile 位于%USERPROFILE%\.dsh,在任何工作区配置下都不会落在工作区里,所以桌面端的插件安装目前必然 EPERM。EPERM/0x5/0xC0000142这类失败应报告为「沙箱拒绝/沙箱不可用」,并附上当前进程完整性级别与目标对象标签。目前的表现会让人去查杀软、查占用、查 ACL,全都查不出东西。与已有报告的关系
0xC0000142。本报告现象 A 与它相邻(都指向 Electron 宿主 + 受限令牌),但成因不同:这里是映像文件本身带 Low 标签导致进程降级,与CREATE_NO_WINDOW/ 控制台无关。复现概要
D:\dsh,并让某个会话的工作区也是D:\dsh;workspace-write初始化(触发标签写入);icacls D:\dsh出现Mandatory Label\Low Mandatory Level:(OI)(CI)(NW),且D:\dsh\DeepSeek Harness.exe继承该标签;0x5);此时whoami /groups(沙箱内)为 Low;pnpmEPERM;icacls "D:\dsh" /setintegritylevel (OI)(CI)Medium /T→ 启动与插件安装均恢复。All reactions