Hi Geoff,
Geoff Levand wrote,
Hi,
I experienced seg faults due to stack corruption when
calling statfs() with an automatic struct statfs variable.
It seems there is a mismatch between the struct statfs used
by libc and that used by the arm64 kernel. The call to
statfs() writes 120 bytes, but struct statfs is only 88
bytes. The attached test program shows this.
Building for arm64.
libuClibc-1.0.30
kernel: Linux-4.17.3
Comparing these files:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tre…
https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libc/sysdeps/linux/c…
I see for the kernel all fields of struct statfs except f_fsid are the
same length at 64 bits for arm64, and that gives 120 bytes. That differs
from the libc version which has some 32 bit fields.
Do you have a patch in mind fixing this difference?
best regards
Waldemar