Package: klibc
Version: 2.0.4-2
Severity: important
Tags: patch

The struct stat is incorrectly defined on ppc64 and ppc64el, causing
the resume binary to fail working correctly and thus hibernation to
work. The patch below gives more explanation and fixes the issue.

>From 5a53f821db8bc887c472d2e5b58986db88b25a11 Mon Sep 17 00:00:00 2001
From: Aurelien Jarno <[email protected]>
Date: Sat, 25 Apr 2015 14:16:16 +0200
Subject: [PATCH] ppc64: fix struct stat

On ppc64 the struct stat defined by klibc matches the kernel one.
However it contains implicit padding before the st_rdev field due to the
64-bit alignement. For internal reasons, klibc defines st_rdev as a pair
of 32-bit values (using the __stdev64 macro). They only need to be
32-bit aligned and as a consequence st->st_rdev is incorrectly defined.

The solution is to add an explicit padding in the structure. This fixes
the resume binary on ppc64 BE and LE, and probably other things.

Signed-off-by: Aurelien Jarno <[email protected]>
---
 usr/include/arch/ppc64/klibc/archstat.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usr/include/arch/ppc64/klibc/archstat.h 
b/usr/include/arch/ppc64/klibc/archstat.h
index 918d810..0bbbff3 100644
--- a/usr/include/arch/ppc64/klibc/archstat.h
+++ b/usr/include/arch/ppc64/klibc/archstat.h
@@ -12,6 +12,7 @@ struct stat {
        mode_t          st_mode;
        uid_t           st_uid;
        gid_t           st_gid;
+       unsigned int    __pad1;
        __stdev64       (st_rdev);
        off_t           st_size;
        unsigned long   st_blksize;
-- 
2.1.4



-- System Information:
Debian Release: 8.0
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: ppc64el (ppc64le)

Kernel: Linux 3.16.0-4-powerpc64le (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to