[ARM/Linux] fstat64 reports epoch nanoseconds as subsecond nanoseconds
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Domínio
- operating-systems
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 6.2k
- Forks
- 806
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de qilingframework/qiling
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
qilingframework/qiling#1690 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
qilingframework/qiling#1689 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
qilingframework/qiling#1688 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
qilingframework/qiling#1686 ·
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 82/100
qilingframework/qiling#1640 ·
Todas as issues de qilingframework/qiling
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
huggingface/datasets#9128 ·
Mantenedores costumam responder em até 1 dia
-
priority:low ready-for-dev
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
OpenHands/extensions#975 ·
Mantenedores costumam responder em até 1 dia
-
Function/dict state handlers can't supply provider-state injected values (`generate.provider_state`)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
pact-foundation/pact-python#1789 ·
Mantenedores costumam responder em até 9 dias
-
documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
juandresrodca/AdminForge#66 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia