evidencectl dev: reading a state file refuses a valid file renamed over between lookup and open
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 72/100
Direção de pesquisa
Read crates/registry-evidencectl/src/dev.rs and safe_path.rs for the RACE_HOOK pattern. Update read_owner_file so the opened descriptor’s metadata is checked directly, then add a deterministic race test that renames a successor over the path after open. Verify the valid replacement is accepted while a hard link or mode change after open is refused.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
What happens
read_owner_file in crates/registry-evidencectl/src/dev.rs looks the state file up by path, then opens it with O_NOFOLLOW, then refuses the read if the opened inode differs from the one it looked up ("owner-only state changed while opening"). State files are replaced by rename. A replacement that lands between the lookup and the open gives a different, perfectly valid inode, so a concurrent evidencectl dev command can refuse a good state file.
bregctl and caseworkctl had the same false refusal and are fixed on the external record projections branch (feat/breg-external-views): the path checks stay before the open, and after the open the descriptor's own fstat is checked (owner, mode, regular file, link count 0 or 1) instead of comparing with a second lookup. O_NOFOLLOW plus the descriptor's fstat describes exactly the inode whose bytes are read, so the invariant holds without the comparison.
Suggested fix
Apply the same change to read_owner_file, with the same deterministic test (a test-only hook after the open that renames a successor over the path, as in safe_path.rs's RACE_HOOK). A hard link or a mode change after the open must still be refused.
Found while verifying the external record projections branch (feat/breg-external-views).
- Linguagem predominante
- Rust
- Estrelas
- 2
- Forks
- 0
- Merge médio
- 9h 48min
- PRs com merge (30d)
- 151
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de registrystack/registry-stack
-
area:breg enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
registrystack/registry-stack#2765 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
registrystack/registry-stack#2761 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
registrystack/registry-stack#2743 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
registrystack/registry-stack#2706 ·
Mantenedores costumam responder em até 1 dia
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directoryAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
registrystack/registry-stack#2704 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de registrystack/registry-stack
Issues semelhantes
-
[Bug] 建议把黑白主题设置同步到启动页面Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
stackabletech/airflow-operator#898 ·
Mantenedores costumam responder em até 1 dia
-
2 advisory ignore entries no longer match anything (`bytes`, `time` already patched in `Cargo.lock`)Talvez já em andamento @zyl71 assumiu hoje. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100