[ARM/Linux] fstat64 reports epoch nanoseconds as subsecond nanoseconds
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
The bug is in the stat64 serializer at qiling/os/posix/syscall/stat.py, which writes the ARM32 Linux subsecond nanoseconds field. Start by reading how the nanosecond value is computed and packed for the ARM32 stat64 layout, then compare it with the layout the issue describes. Done means the field holds only the 0 to 999999999 fraction, and the sample prints mtime=1700000000.123456789 for the fixture created with touch -d.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
On an ARM32 Linux guest, Qiling v1.4.11's fstat64 result places the full epoch nanosecond value into the ABI's subsecond nanoseconds field. The field should contain only the nanosecond fraction within the second.
Sample Code
Create a fresh empty directory named rootfs, create the fixture there, then run an ARM EABI guest that calls fstat64:
mkdir rootfs
touch -d '@1700000000.123456789' rootfs/fixture
#define _GNU_SOURCE
#define _LARGEFILE64_SOURCE
#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <time.h>
int main(void)
{
int fd = open("fixture", O_RDONLY);
struct stat64 st;
if (fd < 0 || fstat64(fd, &st) != 0)
return 1;
printf("mtime=%lld.%09ld\n",
(long long)st.st_mtim.tv_sec, st.st_mtim.tv_nsec);
return 0;
}
arm-linux-gnueabihf-gcc -static -O2 probe.c -o fstat64-probe
Run the ARM guest with Qiling:
from qiling import Qiling
ql = Qiling(["./fstat64-probe"], "./rootfs")
ql.run()
Expected behavior
The mtime fields should be 1700000000 seconds and 123456789 nanoseconds. The nanoseconds field must be in the range 0 through 999999999. Qiling currently writes the epoch nanosecond count into the 32-bit subsecond field.
With this fixture, Qiling narrows 1700000000123456789 to 1032178965; the sample therefore prints mtime=1700000000.1032178965 instead of mtime=1700000000.123456789.
Additional context
Reproduced with Qiling v1.4.11. The current dev source was checked at commit 23ad4fd369a360ad7992d90cb7577f0241061c2b; that exact commit was not dynamically re-run. The affected serializer is in stat.py. The issue concerns the ARM32 Linux stat64 layout.
- 主要言語
- Python
- スター
- 6.2k
- フォーク
- 806
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
qilingframework/qiling のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
qilingframework/qiling#1690 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
qilingframework/qiling#1689 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
qilingframework/qiling#1688 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
qilingframework/qiling#1686 ·
-
難易度 2/5 半日 初心者へのやさしさ 82/100
qilingframework/qiling#1640 ·
qilingframework/qiling の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/datasets#9128 ·
メンテナーはふだん 1 日以内に返信
-
priority:low ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
OpenHands/extensions#975 ·
メンテナーはふだん 1 日以内に返信
-
Function/dict state handlers can't supply provider-state injected values (`generate.provider_state`)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pact-foundation/pact-python#1789 ·
メンテナーはふだん 9 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
juandresrodca/AdminForge#66 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信