mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-06 09:30:06 +00:00
5c95f7b66b
Kay Sievers reported that coreutils' stat tool has a problem with s390's statfs[64] definition: > The definition of struct statfs::f_type needs a fix. s390 is the only > architecture in the kernel that uses an int and expects magic > constants lager than INT_MAX to fit into. > > A fix is needed to make Fedora boot on s390, it currently fails to do > so. Userspace does not want to add code to paper-over this issue. [...] > Even coreutils cannot handle it: > #define RAMFS_MAGIC 0x858458f6 > # stat -f -c%t / > ffffffff858458f6 > > #define BTRFS_SUPER_MAGIC 0x9123683E > # stat -f -c%t /mnt > ffffffff9123683e The bug is caused by an implicit sign extension within the stat tool: out_uint_x (pformat, prefix_len, statfsbuf->f_type); where the format finally will be "%lx". A similar problem can be found in the 'tail' tool. s390 is the only architecture which has an int type f_type member in struct statfs[64]. Other architectures have either unsigned ints or long values, so that the problem doesn't occur there. Therefore change the type of the f_type member to unsigned int, so that we get zero extension instead sign extension when assignment to a long value happens. Reported-by: Kay Sievers <kay@vrfy.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> |
||
---|---|---|
.. | ||
bits | ||
fpu | ||
s390-32 | ||
s390-64 | ||
sys | ||
brk.c | ||
dl-cache.h | ||
dl-procinfo.h | ||
gettimeofday.c | ||
Implies | ||
init-first.c | ||
ldconfig.h | ||
ldd-rewrite.sed | ||
Makefile | ||
nldbl-abi.h | ||
opensock.c | ||
readelflib.c | ||
rt-sysdep.S | ||
sa_len.c | ||
semtimedop.c | ||
sigcontextinfo.h | ||
system.c | ||
ucontext_i.sym | ||
Versions |