glibc/sysdeps
Heiko Carstens 5c95f7b66b S/390: Change struct statfs[64] member types to unsigned values
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>
2013-04-23 08:59:35 +02:00
..
generic New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
gnu s390x: Move rtld link to /lib 2013-03-19 12:08:35 +01:00
i386 Configuring for i386 is no longer supported. 2013-04-17 17:13:20 -07:00
ieee754 [BZ #14686, #15336] Fix standard compliance. Don't use hard-coded qNaN values. 2013-04-05 22:34:52 +02:00
init_array Add sysdeps/init_array to produce empty crt[in].o and use .preinit_array for gcrt1.o 2013-03-12 12:50:13 -07:00
mach BZ#14280: Fix Hurd ioctl macro to avoid warning. 2013-04-08 14:31:38 -07:00
posix Minor cleanup in getaddrinfo 2013-04-22 10:24:00 +05:30
powerpc Refer to two GCC PRs. 2013-04-03 14:13:44 +02:00
pthread BZ#15361: Make aio_fsync not check open modes. 2013-04-12 13:11:20 -07:00
s390 s390/s390x: Undef PSEUDO before redef. 2013-04-06 10:53:54 -04:00
sh Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
sparc Update sparc ULPs. 2013-03-22 13:29:31 -07:00
unix S/390: Change struct statfs[64] member types to unsigned values 2013-04-23 08:59:35 +02:00
wordsize-32 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
wordsize-64 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
x86 Remove miscellaneous bounded-pointers relics in C code. 2013-02-15 00:51:53 +00:00
x86_64 libm-test.inc: Fix tests where cos(PI/2) != 0. 2013-04-11 08:52:18 -04:00