fspy does not record file accesses of static programs on kernels without process_vm_readv
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 68/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- linux, rust
研究方向
Start by reading crates/fspy_seccomp_unotify/src/supervisor/handler/arg.rs:47 and the error handling in crates/fspy_seccomp_unotify/src/supervisor/mod.rs:121. Reproduce with cargo test -p fspy --test static_executable on a kernel where process_vm_readv returns ENOSYS, then add or verify fallback behavior for /proc/<pid>/mem and incomplete tracking. Done means static-program file accesses are recorded on affected kernels and the cache does not retain incomplete results.
由索引模型根據 Issue 內容生成。
描述
Problem
Some Linux kernels do not have the process_vm_readv system call. On these kernels, fspy does not record the file accesses of static programs. The task shows no error.
If you change a file that a static program read, the cache does not detect the change. Then the vp run command uses the old cached output.
On musl builds, fspy uses seccomp for all programs, so this problem affects every tracked program (not tested).
Affected kernels
The CONFIG_CROSS_MEMORY_ATTACH kernel option adds the process_vm_readv system call. The following kernels do not set this option:
- Kata Containers guest kernels. Kata builds these kernels from a configuration that has all options off. Then Kata adds only the options that it needs.
- The default kernel of Apple
container. This kernel is the Kata 3.32.0 kernelvmlinux-6.18.35-197. The/proc/config.gzfile of this kernel shows# CONFIG_CROSS_MEMORY_ATTACH is not set.
The default value of this option is y. Most distribution kernels set it.
Cause
For static programs, fspy intercepts system calls with seccomp. The supervisor process then reads each path argument from the memory of the program.
- The supervisor reads the memory only with the
process_vm_readvsystem call (crates/fspy_seccomp_unotify/src/supervisor/handler/arg.rs:47). - On the affected kernels, the
process_vm_readvsystem call fails with theENOSYSerror. - The supervisor ignores the error and lets the intercepted system call continue (
crates/fspy_seccomp_unotify/src/supervisor/mod.rs:121). - fspy does not record the access.
Steps to reproduce
- Start a Fedora virtual machine (VM) with Apple
containerand its default kernel. - In the VM, check out commit
b182c9be. - Run
cargo test -p fspy --test static_executable.
Result: 9 of 10 tests fail. Only the readdir test passes, because that test does not read the memory of the program. In each failed test, fspy records only the execution of the test program:
Expected accesses to /hello to match, as (actual, expected): [].
All accesses: [Read(".../fspy-test-bin"), Read(".../fspy-test-bin")]
I also tested a child process in the same VM:
- The
process_vm_readvsystem call fails with theENOSYSerror. - A read of the
/proc/<pid>/memfile at the same address returns the correct data.
Possible fixes
- If the
process_vm_readvsystem call fails with theENOSYSerror, read the/proc/<pid>/memfile with thepreadsystem call. This file does not need the kernel option. Reads of this file use the same permission check as theprocess_vm_readvsystem call. I have not tested this fix in fspy. - If the supervisor cannot read an access, do not cache the task. vite-task already does this with the
TrackingIncompletereason when the access channel is full. This fix also covers other read errors, such as permission errors.
- 主要語言
- Rust
- 星號
- 478
- 分支
- 48
- 平均合併
- 1 天 4 小時
- 30 天內合併 PR
- 64
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
voidzero-dev/vite-task 的其他 Issue
-
vp run hangs after a failure when a cancelled task's detached descendant holds its IPC connection未關閉
難度 4/5 3-5 天 新手友好度 48/100
voidzero-dev/vite-task#878 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 28/100
voidzero-dev/vite-task#876 ·
維護者通常 1 天內回覆
-
Existence probes of pnpm-workspace.yaml become content inputs, so any manifest edit misses every task可能已有人在做 @lifeiscontent 於 2 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 45/100
voidzero-dev/vite-task#860 · 1 則留言 ·
維護者通常 1 天內回覆
-
Concurrent cache hits for the same task fail to restore outputs with "File exists (os error 17)"可能已有人在做 @tlq5l 於 3 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 48/100
voidzero-dev/vite-task#846 · 2 則留言 ·
維護者通常 1 天內回覆
-
Windows: automatic filesystem tracking makes Git/MSYS sh.exe fail with MapViewOfFileEx error 487未關閉
難度 5/5 一週以上 新手友好度 18/100
voidzero-dev/vite-task#830 ·
維護者通常 1 天內回覆
查看 voidzero-dev/vite-task 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
area:sim good first issue kind:feature
難度 2/5 1-3 小時 新手友好度 87/100
維護者通常 1 天內回覆
-
bug ui
難度 2/5 1-3 小時 新手友好度 83/100
userFRM/egui-charts#670 ·
維護者通常 1 天內回覆
-
docs good first issue
難度 1/5 1-3 小時 新手友好度 84/100
Usenova-Labs/usenova-backend#35 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 70/100
lugassawan/swe-workbench#823 ·
維護者通常 1 天內回覆