bytecodealliance / bytecodealliance/cap-std

Use O_NOFOLLOW_ANY on macOS

Aperta
#179 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Rust
Stelle
821
Fork
57
Merge medio
1h 16m
PR unite (30g)
4

Descrizione

According to [this blog post](https://blog.malwarebytes.com/mac/2021/08/macos-11s-hidden-security-improvements/#O_NOFOLLOW_ANY), macos 11 has a new `O_NOFOLLOW_ANY` flag that causes `open` to fail if any path component is a symlink. Assuming symlinks are relatively rare, cap-std could use this as a fast path -- check that the path contains no explicit `..` and then open with `O_NOFOLLOW_ANY`; if that succeeds, then we're done. If either of those fails, open with the slow path.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by tracing cap-std's path-opening entry points and the existing fast and slow paths for symlink handling. Check how explicit `..` components are detected and how platform-specific open flags are defined. Done means macOS 11 can use `O_NOFOLLOW_ANY` when safe, while the existing slow path still handles fallback cases.

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

Valutazione

Stack tecnologico
macos, rust
Ambito
operating-systems, security
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.