Launcher store access: check and use the same handle, and log every open
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start at the LibraryAccess/LibraryRegistryAccess layer added by PR #243 in clean/installer/src/wg_core/util.h; read FinalForm, RealPathOk and FindFilesNamed in util.cpp to see where the checked handle is closed. Follow the candidate path from model.cpp (~141) into clean/converter/src/api.cpp (~81, 227) and convert_ignore.cpp (~309-316) — that is where a handle or bytes must replace the path. Done: a unit test swaps the checked folder or file for a junction and the read is refused; hash and convert each log an access line.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background
PR #243 added one store-access layer (clean/installer/src/wg_core/util.h LibraryAccess / LibraryRegistryAccess).
In a WRONGGPU_TESTING build with WRONGGPU_TEST_LIBRARIES set, it confines every store-library read to the test run's
own folder. It refuses paths whose final form differs from their long name, reparse points, files with a second name and
a test folder that resolves elsewhere. It logs every access before the read and refuses a read whose line cannot be
written. The test suite never reads a real store library. Three smaller points remain.
1. Check-then-use: the checked handle is not the read handle
util.cpp checks a path with one handle and closes it. The later read then opens the path again:
FinalForm(around lines 535-541) and the reparse / link-count check inRealPathOk(around 563-568) close their
handles;FindFilesNamedthen enumerates the folder by path (around 636-638) and returns file paths (around 647-648);model.cpp(around line 141) passes such a path to the converter, which opens it again (clean/converter/src/api.cpp
around lines 81 and 227).
If a folder or file is replaced with a junction or link between the check and the use, the read can land somewhere else
while the inside path is logged. In the test suite this needs a concurrent swap inside the suite's own synthetic folders,
so it is not reachable there today. It is still not a strict guarantee.
Proposed:
- Open once with
FILE_FLAG_OPEN_REPARSE_POINT(plusFILE_FLAG_BACKUP_SEMANTICSfor folders). Run the final-path,
reparse and link-count checks on that handle, and use the same handle for the read:- enumerate folders with
GetFileInformationByHandleEx(FileIdBothDirectoryInfo); - read files through the handle.
- enumerate folders with
- Let the converter take an open handle (or a file already read into memory) instead of a path, so the launcher's checked
handle is the one that is read.
2. A log line for every actual open, not only discovery
FindFilesNamed logs each folder walked and each matching file found, but some found files are opened more than once
later without their own access line:
- with a non-empty ignore list,
model.cpp(around lines 61-65) andconvert_ignore.cpp(around 309-316) hash a
candidate, opening it throughutil.cpp(around 660-661); model.cpp(around 139-142) then converts the same candidate, and the converter opens it again.
So a failed log append after discovery does not stop these later reads, and the log cannot account for each open.
Proposed: call LibraryAccess (or the handle-based form from point 1) right before each of these opens, the hash and the
convert, so every open has its own line and the fail-closed rule covers it.
3. Release builds: note what still runs
The final-path, environment and access-log code is compiled only in WRONGGPU_TESTING builds, and LibraryAccess /
LibraryRegistryAccess return true in release builds. Release builds still run two things:
- the unconditional atomic access counter (
LibraryAccessCount; increments aroundutil.cpplines 482, 578 and 605); - the new call sites.
The behaviour is unchanged, but the code path is not literally identical, and no release-build parity test covers it.
Proposed: either keep the counter only in testing builds, or keep it and add a short note to util.h and the README's
Tests section that it is the one piece that runs in release. Add a release-build unit test that LibraryAccess returns
true and changes nothing else.
Done when
- The store-access check and the read use the same handle (folder enumeration and file reads in the launcher; the
converter takes a handle or bytes), with a unit test that swaps a checked folder or file for a junction after the check
and shows the read is refused or stays inside. - Hashing and converting a library candidate each write their own access line, and a failed append refuses them (unit
test). - Release-build behaviour is stated and tested as above.
- Lingua principale
- C++
- Stelle
- 12
- Fork
- 2
- Merge medio
- 3h 10m
- PR unite (30g)
- 171
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di phantoslayer21/wronggpu
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
phantoslayer21/wronggpu#275 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
phantoslayer21/wronggpu#274 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
phantoslayer21/wronggpu#241 ·
I maintainer di solito rispondono entro 1 giorno
-
bug build
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
phantoslayer21/wronggpu#234 ·
I maintainer di solito rispondono entro 1 giorno
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildApertabug build
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
phantoslayer21/wronggpu#233 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di phantoslayer21/wronggpu
Issue simili
-
ai_p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
ClickHouse/ClickHouse#132519 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
juce-framework/JUCE#1810 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
petercorke/robotics-toolbox-python#952 ·
I maintainer di solito rispondono entro 1 giorno
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit statusApertafunc:engine type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NatronGitHub/Natron#1276 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno