summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-11-26 22:02:33 +0000
committerMike Frysinger <vapier@gentoo.org>2013-11-26 22:02:33 +0000
commita9f31e27ba762fe3ff69dc4f3e8c9c7603d32a10 (patch)
tree432676c414e4b0391a9306656ea6da054a16721f
parentinitial 3.11 patchset based on last 3.10 patchset (diff)
downloadlinux-headers-patches-a9f31e27ba762fe3ff69dc4f3e8c9c7603d32a10.tar.gz
linux-headers-patches-a9f31e27ba762fe3ff69dc4f3e8c9c7603d32a10.tar.bz2
linux-headers-patches-a9f31e27ba762fe3ff69dc4f3e8c9c7603d32a10.zip
initial 3.12 patchset based on last 3.11 patchset
-rw-r--r--3.12/00_all_0001-kbuild-auto-convert-size-types-in-userspace-headers.patch31
-rw-r--r--3.12/00_all_0002-linux-stat.h-remove-__GLIBC__-checks.patch28
-rw-r--r--3.12/00_all_0003-linux-pull-in-other-needed-headers-for-userspace.patch40
-rw-r--r--3.12/00_all_0004-netfilter-pull-in-limits.h.patch28
-rw-r--r--3.12/00_all_0005-convert-PAGE_SIZE-usage.patch54
-rw-r--r--3.12/00_all_0006-asm-generic-fcntl.h-namespace-kernel-file-structs.patch54
-rw-r--r--3.12/00_all_0007-unifdef-drop-unused-errno.h-include.patch32
-rw-r--r--3.12/00_all_0008-x86-make-stat-statfs-64-bit-for-x86_64-kernels.patch83
8 files changed, 350 insertions, 0 deletions
diff --git a/3.12/00_all_0001-kbuild-auto-convert-size-types-in-userspace-headers.patch b/3.12/00_all_0001-kbuild-auto-convert-size-types-in-userspace-headers.patch
new file mode 100644
index 0000000..263e30c
--- /dev/null
+++ b/3.12/00_all_0001-kbuild-auto-convert-size-types-in-userspace-headers.patch
@@ -0,0 +1,31 @@
+From 69f8e64bc83ca82d2c40181a503f5a7a83a0151a Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 29 Dec 2008 06:07:47 -0500
+Subject: [PATCH 1/8] kbuild: auto-convert size types in userspace headers
+
+Rather than constantly fixing up size type breakage in userspace headers,
+auto convert the types u_intXX_t, uintXX_t, intXX_t, uXX, and sXX to the
+appropriate __uXX or __sXX type.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ scripts/headers_install.sh | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh
+index 5de5660..38c8b2f 100644
+--- a/scripts/headers_install.sh
++++ b/scripts/headers_install.sh
+@@ -37,6 +37,9 @@ do
+ -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \
+ -e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \
+ -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \
++ -e 's/\b([us](8|16|32|64))\b/__\1/g' \
++ -e 's/\b(u_?int(8|16|32|64)_t)\b/__u\2/g' \
++ -e 's/\b(int(8|16|32|64)_t)\b/__s\2/g' \
+ "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1
+ scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \
+ > "$OUTDIR/$FILE"
+--
+1.8.4.3
+
diff --git a/3.12/00_all_0002-linux-stat.h-remove-__GLIBC__-checks.patch b/3.12/00_all_0002-linux-stat.h-remove-__GLIBC__-checks.patch
new file mode 100644
index 0000000..65a9127
--- /dev/null
+++ b/3.12/00_all_0002-linux-stat.h-remove-__GLIBC__-checks.patch
@@ -0,0 +1,28 @@
+From 5d9f88a07543a57f3679728ad8467e4b9e5f7107 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 29 Dec 2008 06:52:59 -0500
+Subject: [PATCH 2/8] linux/stat.h: remove __GLIBC__ checks
+
+Only check __KERNEL__ so we don't assume the C library is glibc.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/uapi/linux/stat.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h
+index 7fec7e3..256ad24 100644
+--- a/include/uapi/linux/stat.h
++++ b/include/uapi/linux/stat.h
+@@ -2,7 +2,7 @@
+ #define _UAPI_LINUX_STAT_H
+
+
+-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
++#if defined(__KERNEL__)
+
+ #define S_IFMT 00170000
+ #define S_IFSOCK 0140000
+--
+1.8.4.3
+
diff --git a/3.12/00_all_0003-linux-pull-in-other-needed-headers-for-userspace.patch b/3.12/00_all_0003-linux-pull-in-other-needed-headers-for-userspace.patch
new file mode 100644
index 0000000..dcec0e1
--- /dev/null
+++ b/3.12/00_all_0003-linux-pull-in-other-needed-headers-for-userspace.patch
@@ -0,0 +1,40 @@
+From ec3494a65b41f90be98f0a7dbc2e62ade4705964 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 29 Dec 2008 07:41:01 -0500
+Subject: [PATCH 3/8] linux/*: pull in other needed headers for userspace
+
+mondo patch
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/uapi/linux/dn.h | 1 +
+ include/uapi/linux/ppp-ioctl.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/include/uapi/linux/dn.h b/include/uapi/linux/dn.h
+index 5fbdd3d..4295c74 100644
+--- a/include/uapi/linux/dn.h
++++ b/include/uapi/linux/dn.h
+@@ -1,6 +1,7 @@
+ #ifndef _LINUX_DN_H
+ #define _LINUX_DN_H
+
++#include <linux/ioctl.h>
+ #include <linux/types.h>
+ #include <linux/if_ether.h>
+
+diff --git a/include/uapi/linux/ppp-ioctl.h b/include/uapi/linux/ppp-ioctl.h
+index 2d9a885..63a23a3 100644
+--- a/include/uapi/linux/ppp-ioctl.h
++++ b/include/uapi/linux/ppp-ioctl.h
+@@ -12,6 +12,7 @@
+
+ #include <linux/types.h>
+ #include <linux/compiler.h>
++#include <linux/ppp_defs.h>
+
+ /*
+ * Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS.
+--
+1.8.4.3
+
diff --git a/3.12/00_all_0004-netfilter-pull-in-limits.h.patch b/3.12/00_all_0004-netfilter-pull-in-limits.h.patch
new file mode 100644
index 0000000..7261ae4
--- /dev/null
+++ b/3.12/00_all_0004-netfilter-pull-in-limits.h.patch
@@ -0,0 +1,28 @@
+From f37d765f419e8dcf1e3ad8d22cef53819366914b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 9 May 2009 17:30:35 -0400
+Subject: [PATCH 4/8] netfilter: pull in limits.h
+
+A few netfilter sub-headers use INT_MAX which is in limits.h.
+
+URL: http://bugs.gentoo.org/246160
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/uapi/linux/netfilter.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h
+index f7dc0eb..fcb9748 100644
+--- a/include/uapi/linux/netfilter.h
++++ b/include/uapi/linux/netfilter.h
+@@ -4,6 +4,7 @@
+ #include <linux/types.h>
+ #include <linux/compiler.h>
+ #include <linux/sysctl.h>
++#include <limits.h>
+
+
+ /* Responses from hook functions. */
+--
+1.8.4.3
+
diff --git a/3.12/00_all_0005-convert-PAGE_SIZE-usage.patch b/3.12/00_all_0005-convert-PAGE_SIZE-usage.patch
new file mode 100644
index 0000000..a92245e
--- /dev/null
+++ b/3.12/00_all_0005-convert-PAGE_SIZE-usage.patch
@@ -0,0 +1,54 @@
+From 2532dc2cc6a68f403da6ab8ec5585ac24e370906 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 13 Feb 2010 03:09:23 -0500
+Subject: [PATCH 5/8] convert PAGE_SIZE usage
+
+The size of a page may change at runtime or based on kernel settings, so
+a static value at compile time doesn't work. More importantly, no one
+exports PAGE_SIZE to user space anymore.
+
+URL: http://bugs.gentoo.org/301431
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/uapi/linux/binfmts.h | 3 ++-
+ include/uapi/linux/resource.h | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h
+index 4eb5972..516bfcf 100644
+--- a/include/uapi/linux/binfmts.h
++++ b/include/uapi/linux/binfmts.h
+@@ -1,6 +1,7 @@
+ #ifndef _UAPI_LINUX_BINFMTS_H
+ #define _UAPI_LINUX_BINFMTS_H
+
++#include <unistd.h>
+ #include <linux/capability.h>
+
+ struct pt_regs;
+@@ -11,7 +12,7 @@ struct pt_regs;
+ * prevent the kernel from being unduly impacted by misaddressed pointers.
+ * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
+ */
+-#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
++#define MAX_ARG_STRLEN (sysconf(_SC_PAGESIZE) * 32)
+ #define MAX_ARG_STRINGS 0x7FFFFFFF
+
+ /* sizeof(linux_binprm->buf) */
+diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
+index e0ed284..db8acf3 100644
+--- a/include/uapi/linux/resource.h
++++ b/include/uapi/linux/resource.h
+@@ -68,7 +68,8 @@ struct rlimit64 {
+ * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
+ * and other sensitive information are never written to disk.
+ */
+-#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
++/* No one currently defines PAGE_SIZE bigger than 64kB */
++#define MLOCK_LIMIT (64 * 1024)
+
+ /*
+ * Due to binary compatibility, the actual resource numbers
+--
+1.8.4.3
+
diff --git a/3.12/00_all_0006-asm-generic-fcntl.h-namespace-kernel-file-structs.patch b/3.12/00_all_0006-asm-generic-fcntl.h-namespace-kernel-file-structs.patch
new file mode 100644
index 0000000..f48d492
--- /dev/null
+++ b/3.12/00_all_0006-asm-generic-fcntl.h-namespace-kernel-file-structs.patch
@@ -0,0 +1,54 @@
+From 9d59752762a945a828d552b6d30aaf3078b9364a Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 29 Dec 2008 07:39:14 -0500
+Subject: [PATCH 6/8] asm-generic/fcntl.h: namespace kernel file structs
+
+No one should be using these structs, but just in case they are,
+keep them available in the __kernel_ namespace.
+
+Otherwise, trying to include something like:
+ #include <fcntl.h>
+ #include <linux/inotify.h>
+leads to horrible failure.
+
+URL: http://bugs.gentoo.org/244470
+URL: http://bugs.gentoo.org/388633
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/uapi/asm-generic/fcntl.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
+index 95e46c8..92c2df2 100644
+--- a/include/uapi/asm-generic/fcntl.h
++++ b/include/uapi/asm-generic/fcntl.h
+@@ -136,7 +136,7 @@
+ #define F_OWNER_PID 1
+ #define F_OWNER_PGRP 2
+
+-struct f_owner_ex {
++struct __kernel_f_owner_ex {
+ int type;
+ __kernel_pid_t pid;
+ };
+@@ -176,7 +176,7 @@ struct f_owner_ex {
+ #define __ARCH_FLOCK_PAD
+ #endif
+
+-struct flock {
++struct __kernel_flock {
+ short l_type;
+ short l_whence;
+ __kernel_off_t l_start;
+@@ -193,7 +193,7 @@ struct flock {
+ #define __ARCH_FLOCK64_PAD
+ #endif
+
+-struct flock64 {
++struct __kernel_flock64 {
+ short l_type;
+ short l_whence;
+ __kernel_loff_t l_start;
+--
+1.8.4.3
+
diff --git a/3.12/00_all_0007-unifdef-drop-unused-errno.h-include.patch b/3.12/00_all_0007-unifdef-drop-unused-errno.h-include.patch
new file mode 100644
index 0000000..4448ffb
--- /dev/null
+++ b/3.12/00_all_0007-unifdef-drop-unused-errno.h-include.patch
@@ -0,0 +1,32 @@
+From 5ae7b6aa1a37db4bcfb381c207036ac674c2a0b8 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 6 Dec 2011 17:22:42 -0500
+Subject: [PATCH 7/8] unifdef: drop unused errno.h include
+
+This is the only header on my system that ends up requiring kernel
+headers, so if the kernel headers aren't available, we end up being
+unable to install kernel headers :).
+
+Since this file doesn't actually use anything from errno.h, drop
+the include so it at least makes us a bit more robust on glibc.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ scripts/unifdef.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/scripts/unifdef.c b/scripts/unifdef.c
+index 7493c0e..c5dfae5 100644
+--- a/scripts/unifdef.c
++++ b/scripts/unifdef.c
+@@ -48,7 +48,6 @@
+
+ #include <ctype.h>
+ #include <err.h>
+-#include <errno.h>
+ #include <stdarg.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+--
+1.8.4.3
+
diff --git a/3.12/00_all_0008-x86-make-stat-statfs-64-bit-for-x86_64-kernels.patch b/3.12/00_all_0008-x86-make-stat-statfs-64-bit-for-x86_64-kernels.patch
new file mode 100644
index 0000000..dd3f0a9
--- /dev/null
+++ b/3.12/00_all_0008-x86-make-stat-statfs-64-bit-for-x86_64-kernels.patch
@@ -0,0 +1,83 @@
+From babce69d601f845b8bcd1cdecb07da3659879175 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 25 Mar 2013 16:38:47 -0400
+Subject: [PATCH 8/8] x86: make stat/statfs 64-bit for x86_64 kernels
+
+When including these headers in the x32 ABI, the structs get declared
+with 32bit sizes which is incorrect. Use long long and such to make
+it work both with x32 and x86_64.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ arch/x86/include/uapi/asm/stat.h | 38 +++++++++++++++++++-------------------
+ arch/x86/include/uapi/asm/statfs.h | 5 +++++
+ 2 files changed, 24 insertions(+), 19 deletions(-)
+
+diff --git a/arch/x86/include/uapi/asm/stat.h b/arch/x86/include/uapi/asm/stat.h
+index 7b3ddc3..e9d6951 100644
+--- a/arch/x86/include/uapi/asm/stat.h
++++ b/arch/x86/include/uapi/asm/stat.h
+@@ -78,26 +78,26 @@ struct stat64 {
+ #else /* __i386__ */
+
+ struct stat {
+- unsigned long st_dev;
+- unsigned long st_ino;
+- unsigned long st_nlink;
+-
+- unsigned int st_mode;
+- unsigned int st_uid;
+- unsigned int st_gid;
+- unsigned int __pad0;
+- unsigned long st_rdev;
+- long st_size;
+- long st_blksize;
+- long st_blocks; /* Number 512-byte blocks allocated. */
++ unsigned long long st_dev;
++ unsigned long long st_ino;
++ unsigned long long st_nlink;
+
+- unsigned long st_atime;
+- unsigned long st_atime_nsec;
+- unsigned long st_mtime;
+- unsigned long st_mtime_nsec;
+- unsigned long st_ctime;
+- unsigned long st_ctime_nsec;
+- long __unused[3];
++ unsigned int st_mode;
++ unsigned int st_uid;
++ unsigned int st_gid;
++ unsigned int __pad0;
++ unsigned long long st_rdev;
++ long long st_size;
++ long long st_blksize;
++ long long st_blocks; /* Number 512-byte blocks allocated. */
++
++ unsigned long long st_atime;
++ unsigned long long st_atime_nsec;
++ unsigned long long st_mtime;
++ unsigned long long st_mtime_nsec;
++ unsigned long long st_ctime;
++ unsigned long long st_ctime_nsec;
++ long long __unused[3];
+ };
+
+ /* We don't need to memset the whole thing just to initialize the padding */
+diff --git a/arch/x86/include/uapi/asm/statfs.h b/arch/x86/include/uapi/asm/statfs.h
+index 2d0adbf..3cb5744 100644
+--- a/arch/x86/include/uapi/asm/statfs.h
++++ b/arch/x86/include/uapi/asm/statfs.h
+@@ -8,5 +8,10 @@
+ */
+ #define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
+
++/* For x86-64, both the 64bit and x32 ABIs have 64bit fields. */
++#ifdef __x86_64__
++#define __statfs_word __u64
++#endif
++
+ #include <asm-generic/statfs.h>
+ #endif /* _ASM_X86_STATFS_H */
+--
+1.8.4.3
+