compile: fd-anchored compiled-output writes and a single base-directory resolve

Aperta
#5,311 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

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
22/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
security

Direzione di ricerca

Start with the compiled-output writer touched by #5190/#5308 and the confined-writer work in #5182, since this extends both. Trace where the writer resolves its base directory per write and where the directory chain is currently re-checked before writing; the batch loop is where the resolve-once change lands. The acceptance test is a cell that swaps a directory for a link between check and write (POSIX only) plus a call-count assertion that the base directory resolves once per batch. Expect to need the existing writer test suite to reproduce the check-then-write window first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement status/accepted

Follow-up of the compiled-output writer change (#5190, carried in #5308).

  1. Race-free write path on POSIX. Each compiled write now re-checks its directory chain for links right before writing, which narrows but does not close the window between check and write. Write through an fd-anchored path instead: open each directory with O_DIRECTORY | O_NOFOLLOW from the project root, then create the file with openat relative to the final directory fd. A link swapped into the chain is then refused by the open itself. This belongs with the confined-writer work (#5182).
  2. Resolve the base directory once. The writer resolves its base directory twice per write; resolve it once per batch.

Done when: on POSIX, a cell that swaps a directory for a link between check and write shows the write refused with nothing written outside the project, and the base directory is resolved once per batch (asserted by a call count).

Lingua principale
Python
Stelle
4.4k
Fork
430
Merge medio
19h 38m
PR unite (30g)
637

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/apm

Tutte le issue di microsoft/apm

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.