[kernel] r14365 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Fri Oct 9 03:45:31 UTC 2009


Author: benh
Date: Fri Oct  9 03:45:28 2009
New Revision: 14365

Log:
Sanitise <linux/socket.h> and <linux/uio.h> (Closes: #538372)

Added:
   dists/lenny/linux-2.6/debian/patches/bugfix/all/sanitise-linux-socket-h.patch
   dists/lenny/linux-2.6/debian/patches/bugfix/all/sanitise-linux-uio-h.patch
Modified:
   dists/lenny/linux-2.6/debian/changelog
   dists/lenny/linux-2.6/debian/patches/series/20

Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog	Fri Oct  9 03:35:49 2009	(r14364)
+++ dists/lenny/linux-2.6/debian/changelog	Fri Oct  9 03:45:28 2009	(r14365)
@@ -18,6 +18,7 @@
   * v4l2: Improve 32/64-bit ioctl translation (Closes: #508649)
   * proc: Fix truncation of entries in /proc/*/pagemap on 32-bit
     architectures (Closes: #511419)
+  * Sanitise <linux/socket.h> and <linux/uio.h> (Closes: #538372)
 
   [ dann frazier ]
   * autofs4: don't make expiring dentry negative, avoiding an oops

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/sanitise-linux-socket-h.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/sanitise-linux-socket-h.patch	Fri Oct  9 03:45:28 2009	(r14365)
@@ -0,0 +1,71 @@
+Subject: [PATCH] net: Support inclusion of <linux/socket.h> before <sys/socket.h>
+From: Ben Hutchings <ben at decadent.org.uk>
+Author: Bastian Blank <waldi at debian.org>
+
+The following user-space program fails to compile:
+
+    #include <linux/socket.h>
+    #include <sys/socket.h>
+    int main() { return 0; }
+
+The reason is that <linux/socket.h> tests __GLIBC__ to decide whether it
+should define various structures and macros that are now defined for
+user-space by <sys/socket.h>, but __GLIBC__ is not defined if no libc
+headers have yet been included.
+
+It seems safe to drop support for libc 5 now.
+
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+Signed-off-by: Bastian Blank <waldi at debian.org>
+---
+--- a/include/linux/socket.h
++++ b/include/linux/socket.h
+@@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage {
+ 				/* _SS_MAXSIZE value minus size of ss_family */
+ } __attribute__ ((aligned(_K_SS_ALIGNSIZE)));	/* force desired alignment */
+ 
+-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
++#ifdef __KERNEL__
+ 
+ #include <asm/socket.h>			/* arch-dependent defines	*/
+ #include <linux/sockios.h>		/* the SIOCxxx I/O controls	*/
+@@ -101,21 +101,6 @@ struct cmsghdr {
+ 			      ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
+ 
+ /*
+- *	This mess will go away with glibc
+- */
+- 
+-#ifdef __KERNEL__
+-#define __KINLINE static inline
+-#elif  defined(__GNUC__) 
+-#define __KINLINE static __inline__
+-#elif defined(__cplusplus)
+-#define __KINLINE static inline
+-#else
+-#define __KINLINE static
+-#endif
+-
+-
+-/*
+  *	Get the next cmsg header
+  *
+  *	PLEASE, do not touch this function. If you think, that it is
+@@ -128,7 +113,7 @@ struct cmsghdr {
+  *	ancillary object DATA.				--ANK (980731)
+  */
+  
+-__KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
++static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
+ 					       struct cmsghdr *__cmsg)
+ {
+ 	struct cmsghdr * __ptr;
+@@ -140,7 +125,7 @@ __KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
+ 	return __ptr;
+ }
+ 
+-__KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
++static inline struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
+ {
+ 	return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
+ }

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/sanitise-linux-uio-h.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/sanitise-linux-uio-h.patch	Fri Oct  9 03:45:28 2009	(r14365)
@@ -0,0 +1,66 @@
+From 812ed032cdc8138b7546eecc996879756b92d801 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jirislaby at gmail.com>
+Date: Wed, 29 Jul 2009 15:04:19 -0700
+Subject: [PATCH] uio: mark uio.h functions __KERNEL__ only
+
+To avoid userspace build failures such as:
+
+.../linux/uio.h:37: error: expected `=', `,', `;', `asm' or `__attribute__' before `iov_length'
+.../linux/uio.h:47: error: expected declaration specifiers or `...' before `size_t'
+
+move uio functions inside a __KERNEL__ block.
+
+Signed-off-by: Jiri Slaby <jirislaby at gmail.com>
+Acked-by: Sam Ravnborg <sam at ravnborg.org>
+Cc: Alexander Viro <viro at zeniv.linux.org.uk>
+Cc: Christoph Hellwig <hch at infradead.org>
+Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
+---
+ include/linux/uio.h |   17 ++++++++---------
+ 1 files changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/include/linux/uio.h b/include/linux/uio.h
+index b7fe138..98c1143 100644
+--- a/include/linux/uio.h
++++ b/include/linux/uio.h
+@@ -19,15 +19,6 @@ struct iovec
+ 	__kernel_size_t iov_len; /* Must be size_t (1003.1g) */
+ };
+ 
+-#ifdef __KERNEL__
+-
+-struct kvec {
+-	void *iov_base; /* and that should *never* hold a userland pointer */
+-	size_t iov_len;
+-};
+-
+-#endif
+-
+ /*
+  *	UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
+  */
+@@ -35,6 +26,13 @@ struct kvec {
+ #define UIO_FASTIOV	8
+ #define UIO_MAXIOV	1024
+ 
++#ifdef __KERNEL__
++
++struct kvec {
++	void *iov_base; /* and that should *never* hold a userland pointer */
++	size_t iov_len;
++};
++
+ /*
+  * Total number of bytes covered by an iovec.
+  *
+@@ -53,5 +51,6 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
+ }
+ 
+ unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
++#endif
+ 
+ #endif
+-- 
+1.6.4.3
+

Modified: dists/lenny/linux-2.6/debian/patches/series/20
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/20	Fri Oct  9 03:35:49 2009	(r14364)
+++ dists/lenny/linux-2.6/debian/patches/series/20	Fri Oct  9 03:45:28 2009	(r14365)
@@ -10,4 +10,6 @@
 + bugfix/all/v4l2-add-some-missing-compat32-ioctls.patch
 + bugfix/all/v4l2-compat-test-for-unlocked_ioctl.patch
 + bugfix/all/pagemap-fix-32-bit-pagemap-regression.patch
++ bugfix/all/sanitise-linux-socket-h.patch
++ bugfix/all/sanitise-linux-uio-h.patch
 + features/all/ftdi_sio-openrd.patch



More information about the Kernel-svn-changes mailing list