mirror of git://sourceware.org/git/glibc.git
GCC mainline shows the following error: ../sysdeps/unix/sysv/linux/mips/mips64/getdents64.c: In function '__getdents64': ../sysdeps/unix/sysv/linux/mips/mips64/getdents64.c:121:7: error: 'memcpy' forming offset [4, 7] is out of the bounds [0, 4] [-Werror=array-bounds] 121 | memcpy (((char *) dp + offsetof (struct dirent64, d_ino)), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | KDP_MEMBER (kdp, d_ino), sizeof ((struct dirent64){0}.d_ino)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/unix/sysv/linux/mips/mips64/getdents64.c:123:7: error: 'memcpy' forming offset [4, 7] is out of the bounds [0, 4] [-Werror=array-bounds] 123 | memcpy (((char *) dp + offsetof (struct dirent64, d_off)), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 124 | KDP_MEMBER (kdp, d_off), sizeof ((struct dirent64){0}.d_off)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The issue is due both d_ino and d_off fields for mips64-n32 kernel_dirent are 32-bits, while this is using memcpy to copy 64 bits from it into the glibc dirent64. The fix is to use a temporary buffer to read the correct type from kernel_dirent. Checked with a build-many-glibcs.py for mips64el-linux-gnu and I also checked the tst-getdents64 on mips64el 4.1.4 kernel with and without fallback enabled (by manually setting the getdents64_supported). |
||
---|---|---|
.. | ||
n32 | ||
n64 | ||
Makefile | ||
configure | ||
configure.ac | ||
fxstat64.c | ||
fxstatat.c | ||
fxstatat64.c | ||
getdents64.c | ||
ipc_priv.h | ||
kstat_cp.h | ||
ldconfig.h | ||
ldd-rewrite.sed | ||
libBrokenLocale.abilist | ||
libanl.abilist | ||
libcrypt.abilist | ||
libdl.abilist | ||
libm.abilist | ||
libnsl.abilist | ||
libpthread.abilist | ||
librt.abilist | ||
libthread_db.abilist | ||
libutil.abilist | ||
lxstat64.c | ||
msgctl.c | ||
semctl.c | ||
shmctl.c | ||
syscall.S | ||
sysdep.h | ||
xstat64.c |