glibc/sysdeps/unix/sysv/linux/s390
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
..
bits S/390: Change struct statfs[64] member types to unsigned values 2013-04-23 08:59:35 +02:00
fpu Implement accurate fma. 2010-10-13 22:27:03 -04:00
s390-32 New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
s390-64 New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
sys Sync with Linux 3.8 2013-03-06 16:35:19 +01:00
brk.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-cache.h Update. 2003-06-25 08:19:44 +00:00
dl-procinfo.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
gettimeofday.c Remove CHECK_1 and CHECK_1_NULL_OK. 2013-02-08 01:12:11 +00:00
Implies * math/divtc3.c: New file. 2006-02-01 03:02:06 +00:00
init-first.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ldconfig.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ldd-rewrite.sed
Makefile Convert WORDSIZE[32|64]/ld entries to abi-variants 2012-05-30 08:33:26 -07:00
nldbl-abi.h * math/divtc3.c: New file. 2006-02-01 03:02:06 +00:00
opensock.c * sysdeps/unix/sysv/linux/Makefile [subdir=inet] (sysdep_headers): 2007-11-23 15:19:41 +00:00
readelflib.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
rt-sysdep.S Update. 2004-04-18 02:37:56 +00:00
sa_len.c * sysdeps/unix/sysv/linux/Makefile [subdir=inet] (sysdep_headers): 2007-11-23 15:19:41 +00:00
semtimedop.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
sigcontextinfo.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
system.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ucontext_i.sym S/390: Fix rt_sigprocmask syscall invocation in get/set/swapcontext. 2013-03-05 08:15:33 +01:00
Versions * sysdeps/unix/sysv/linux/s390/bits/libc-vdso.h: New file. 2009-01-08 00:28:23 +00:00