NVIDIA / NVIDIA/cuda-python

[DOC]: cuda.core 1.1.1 note misstates program cache permissions

Offen Anfängerfreundlich
#2,717 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

triage
Vorherrschende Sprache
Cython
Sterne
3.4k
Forks
329
Ø Merge
1 T. 21 Std.
Gemergte PRs (30 T.)
113

Beschreibung

  • I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Is this for new documentation, or an update to existing docs?

Update

Describe the incorrect/future/missing documentation

The cuda.core 1.1.1 release note says the on-disk program cache directory is created with owner-only permissions (0o700), that those permissions are re-asserted on each use, and that this prevents other local users from reading or injecting cached device code regardless of the process umask. Only the tmp/ staging directory is created 0o700. The cache root, entries/ and the shard directories inherit the umask, and no permissions are re-asserted, so a cache created under a permissive umask stays world-writable after a write.

import os, stat, tempfile
from pathlib import Path
from cuda.core.utils import FileStreamProgramCache

os.umask(0o000)
root = Path(tempfile.mkdtemp()) / "pc"
FileStreamProgramCache(path=root)["k"] = b"hello"
for p in (root, root / "entries", root / "tmp"):
    print(p.name, oct(stat.S_IMODE(os.stat(p).st_mode)))
pc 0o777
entries 0o777
tmp 0o700

Expected: the note describes what shipped. Cache entry files are 0o600 and tmp/ is 0o700, so cached device code is not readable by other users, but the cache root and entries/ follow the umask and a pre-existing shared cache directory is used as-is.

cuda_core/cuda/core/utils/_program_cache/_file_stream.py also records the trade-off this leaves (a deliberately shared writable entries/ lets a co-owner replace a cached file). Whether the note should state that as well is your call.

If this is a correction, please provide a link to the incorrect documentation. If this is a new documentation request, please link to where you have looked.

https://nvidia.github.io/cuda-python/cuda-core/latest/release/1.1.1-notes.html

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Lies die verlinkte cuda-core 1.1.1-Release-Note und vergleiche sie mit cuda_core/cuda/core/utils/_program_cache/_file_stream.py. Führe bei Bedarf das bereitgestellte FileStreamProgramCache-Beispiel aus, um die angegebenen Berechtigungen zu überprüfen. Als abgeschlossen gilt die Aufgabe, wenn die Notiz die Cache-Root, Einträge, Entry-Dateien, das tmp-Verzeichnis, das umask-Verhalten und jeden dokumentierten Trade-off eines gemeinsam genutzten Caches korrekt beschreibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
88/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.