Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

fspy does not record file accesses of static programs on kernels without process_vm_readv

オープン
#858 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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 kernel vmlinux-6.18.35-197. The /proc/config.gz file 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.

  1. The supervisor reads the memory only with the process_vm_readv system call (crates/fspy_seccomp_unotify/src/supervisor/handler/arg.rs:47).
  2. On the affected kernels, the process_vm_readv system call fails with the ENOSYS error.
  3. The supervisor ignores the error and lets the intercepted system call continue (crates/fspy_seccomp_unotify/src/supervisor/mod.rs:121).
  4. fspy does not record the access.

Steps to reproduce

  1. Start a Fedora virtual machine (VM) with Apple container and its default kernel.
  2. In the VM, check out commit b182c9be.
  3. 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_readv system call fails with the ENOSYS error.
  • A read of the /proc/<pid>/mem file at the same address returns the correct data.

Possible fixes

  1. If the process_vm_readv system call fails with the ENOSYS error, read the /proc/<pid>/mem file with the pread system call. This file does not need the kernel option. Reads of this file use the same permission check as the process_vm_readv system call. I have not tested this fix in fspy.
  2. If the supervisor cannot read an access, do not cache the task. vite-task already does this with the TrackingIncomplete reason when the access channel is full. This fix also covers other read errors, such as permission errors.
主要言語
Rust
スター
478
フォーク
48
平均マージ
1日 3時間
マージ済み PR(30日)
72

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/vite-task のほかの issue

voidzero-dev/vite-task の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。