[ARM/Linux] fstat64 reports epoch nanoseconds as subsecond nanoseconds
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 72/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Bereich
- operating-systems
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 6.2k
- Forks
- 806
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus qilingframework/qiling
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
qilingframework/qiling#1690 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
qilingframework/qiling#1689 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
qilingframework/qiling#1688 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
qilingframework/qiling#1686 ·
-
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 82/100
qilingframework/qiling#1640 ·
Alle Issues in qilingframework/qiling
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
huggingface/datasets#9128 ·
Maintainer antworten meist innerhalb von 1 Tag
-
priority:low ready-for-dev
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
OpenHands/extensions#975 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Function/dict state handlers can't supply provider-state injected values (`generate.provider_state`)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
pact-foundation/pact-python#1789 ·
Maintainer antworten meist innerhalb von 9 Tagen
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
juandresrodca/AdminForge#66 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag