lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1471890809-4383-68-git-send-email-mikko.rapeli@iki.fi>
Date:   Mon, 22 Aug 2016 20:33:24 +0200
From:   Mikko Rapeli <mikko.rapeli@....fi>
To:     linux-kernel@...r.kernel.org
Cc:     Mikko Rapeli <mikko.rapeli@....fi>,
        "David S. Miller" <davem@...emloft.net>,
        Nicolas Dichtel <nicolas.dichtel@...nd.com>
Subject: [PATCH v05 67/72] uapi uio.h: glibc sys/uio.h header file compatibility fixes

Fixes this userspace compile error when glibc sys/uio.h is included
before linux/uio.h:

linux/uio.h:16:8: error: redefinition of ‘struct iovec’

Signed-off-by: Mikko Rapeli <mikko.rapeli@....fi>
---
 include/uapi/linux/libc-compat.h | 10 ++++++++++
 include/uapi/linux/uio.h         |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 8a5a7cc..f793b09 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -180,6 +180,13 @@
 
 #endif /* defined(__NETIPX_IPX_H) */
 
+/* Definitions for sys/uio.h */
+#if defined(_SYS_UIO_H)
+#define __UAPI_DEF_IOVEC		0
+#else /* defined(_SYS_UIO_H) */
+#define __UAPI_DEF_IOVEC		1
+#endif /* defined(_SYS_UIO_H) */
+
 /* Definitions for xattr.h */
 #if defined(_SYS_XATTR_H)
 #define __UAPI_DEF_XATTR		0
@@ -235,6 +242,9 @@
 #define __UAPI_DEF_IPX_CONFIG_DATA		1
 #define __UAPI_DEF_IPX_ROUTE_DEF		1
 
+/* Definitions for uio.h */
+#define __UAPI_DEF_IOVEC		1
+
 /* Definitions for xattr.h */
 #define __UAPI_DEF_XATTR		1
 
diff --git a/include/uapi/linux/uio.h b/include/uapi/linux/uio.h
index 2731d56..cba4819 100644
--- a/include/uapi/linux/uio.h
+++ b/include/uapi/linux/uio.h
@@ -9,15 +9,17 @@
 #ifndef _UAPI__LINUX_UIO_H
 #define _UAPI__LINUX_UIO_H
 
+#include <linux/libc-compat.h>
 #include <linux/compiler.h>
 #include <linux/types.h>
 
-
+#if __UAPI_DEF_IOVEC
 struct iovec
 {
 	void __user *iov_base;	/* BSD uses caddr_t (1003.1g requires void *) */
 	__kernel_size_t iov_len; /* Must be size_t (1003.1g) */
 };
+#endif /* __UAPI_DEF_IOVEC */
 
 /*
  *	UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
-- 
2.8.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ