This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.17-549-g5c95f7b


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  5c95f7b66be2e59cf26f3c29cfab7657880bd76d (commit)
      from  d34c915826734cf20b189e925aac9b9f176bcd53 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5c95f7b66be2e59cf26f3c29cfab7657880bd76d

commit 5c95f7b66be2e59cf26f3c29cfab7657880bd76d
Author: Heiko Carstens <heiko.carstens@de.ibm.com>
Date:   Tue Apr 23 08:53:44 2013 +0200

    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>

diff --git a/ChangeLog b/ChangeLog
index e16ef0a..4b41c6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-23  Heiko Carstens  <heiko.carstens@de.ibm.com>
+
+	* sysdeps/unix/sysv/linux/s390/bits/statfs.h: Change types of
+	f_type, f_bsize, f_namelen, f_frsize, f_flags,and f_spare to
+	unsigned.
+
 2013-04-22  Jan-Benedict Glaw  <jbglaw@getslash.de>
 
 	* nss/getent.c (shadow_keys): Call endspent, not endpwent.
diff --git a/sysdeps/unix/sysv/linux/s390/bits/statfs.h b/sysdeps/unix/sysv/linux/s390/bits/statfs.h
index ff54607..91dde15 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/statfs.h
@@ -23,8 +23,8 @@
 
 struct statfs
   {
-    int f_type;
-    int f_bsize;
+    unsigned int f_type;
+    unsigned int f_bsize;
 #ifndef __USE_FILE_OFFSET64
     __fsblkcnt_t f_blocks;
     __fsblkcnt_t f_bfree;
@@ -39,27 +39,27 @@ struct statfs
     __fsfilcnt64_t f_ffree;
 #endif
     __fsid_t f_fsid;
-    int f_namelen;
-    int f_frsize;
-    int f_flags;
-    int f_spare[4];
+    unsigned int f_namelen;
+    unsigned int f_frsize;
+    unsigned int f_flags;
+    unsigned int f_spare[4];
   };
 
 #ifdef __USE_LARGEFILE64
 struct statfs64
   {
-    int f_type;
-    int f_bsize;
+    unsigned int f_type;
+    unsigned int f_bsize;
     __fsblkcnt64_t f_blocks;
     __fsblkcnt64_t f_bfree;
     __fsblkcnt64_t f_bavail;
     __fsfilcnt64_t f_files;
     __fsfilcnt64_t f_ffree;
     __fsid_t f_fsid;
-    int f_namelen;
-    int f_frsize;
-    int f_flags;
-    int f_spare[4];
+    unsigned int f_namelen;
+    unsigned int f_frsize;
+    unsigned int f_flags;
+    unsigned int f_spare[4];
   };
 #endif
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                  |    6 ++++++
 sysdeps/unix/sysv/linux/s390/bits/statfs.h |   24 ++++++++++++------------
 2 files changed, 18 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]