[ARM/Linux] fstat64 reports epoch nanoseconds as subsecond nanoseconds
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 6.2k
- Fork
- 806
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của qilingframework/qiling
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
qilingframework/qiling#1690 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
qilingframework/qiling#1689 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
qilingframework/qiling#1688 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
qilingframework/qiling#1686 ·
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 82/100
qilingframework/qiling#1640 ·
Tất cả issue của qilingframework/qiling
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
huggingface/datasets#9128 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:low ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
OpenHands/extensions#975 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Function/dict state handlers can't supply provider-state injected values (`generate.provider_state`)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pact-foundation/pact-python#1789 ·
Maintainer thường phản hồi trong vòng 9 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
juandresrodca/AdminForge#66 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày