test(libkernel): drop backup privileges in denied parent watch #6599
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6599"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:24:15Z.
What
Remove
SeBackupPrivilegeandSeRestorePrivilegefrom the process token beforeDeniedParentWatchchanges the parent directory DACL. Elevated Windows processes can otherwise bypass that DACL and abort the test instead of exercising the expected denied-open path. The privilege adjustment succeeds without changing non-elevated tokens that do not hold these privileges.Fixes #6597. The related open PR #6173 changes the ACL trustee from a username to the process token SID; this change handles the separate backup-privilege bypass in elevated processes.
Tested
guest_kqueue.GuestKqueue.cppcompiled with-std=c++20 -D_WIN32 -Wall -Wextra -Werror.python3 tools/check_conventions.py --base upstream/main: passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T22:28:22Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/tests/GuestKqueue.cppcore/libs/tests/GuestKqueue.cppcore/libs/tests/GuestKqueue.cppImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T22:28:51Z.
Manual overlap check for the bot warning: #6044 does not change
GuestKqueue.cpp(its path list contains only test/build organization files). #6343 adds aStandardInputcase near the file end and calls it at the start ofmain; #6510 adds kqueue flag tests and their calls before the existing file-watch cases. Neither changesDeniedParentWatchor the point where it runs. This PR’s privilege helpers are called only fromDeniedParentWatch, so there is no dependency or overlapping behavior.Imported from boykopovar/AnyPS5. Originally posted by harmsluis on 2026-10-15T23:50:01Z.
Tested the non-elevated Windows path (the
ERROR_NOT_ALL_ASSIGNEDcase not run in #6597).Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
BUILD_TESTING=ON. The process is not elevated and its token holds neitherSeBackupPrivilegenorSeRestorePrivilege(whoami /priv).main5d9dcc42d:ctest -R '^guest_kqueue$' --repeat until-fail:3passes 3 of 3.083f1cc9d):GuestKqueue.cppbuilds without warnings; same command passes 3 of 3.Not run: elevated (covered in #6597), Linux (the change is inside
#ifdef _WIN32).AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T23:52:42Z.
Thanks @harmsluis for the independent Windows check. I’ve recorded the additional scope: on Windows 11 with WinLibs MinGW-w64 GCC 15.2.0 Release, the non-elevated
guest_kqueuetest passes 3/3 on both currentmainand this PR; the changed test file also builds without warnings. Elevated execution remains supported by the original 3/3 report in #6597, not a local run from this PR environment. Linux and the full suite remain untested here.Imported from boykopovar/AnyPS5. Originally posted by PYTHONRETARDE on 2026-10-15T23:54:13Z.
Non-elevated Windows data point (Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release), the case the issue lists as not run. On this machine the user name equals the computer name, so
DeniedParentWatchalso needs #6173.guest_kqueuemain03c4cb5e7+ #6452 + this PR (083f1cc9d)the vnode watch error lacks "parent"(#6173's cause, not this PR's)c494f3352, merges cleanly)So the
ERROR_NOT_ALL_ASSIGNEDpath works without elevation, and the two changes combine.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T15:59:18Z.
Thanks for testing the non-elevated
ERROR_NOT_ALL_ASSIGNEDpath and for isolating the"parent"message failure to #6173. I have recorded the result: this PR passes when composed with #6173, while the standalone failure is attributable to that separate vnode-watch change.