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: <529385AF0200007800106C84@nat28.tlf.novell.com>
Date:	Mon, 25 Nov 2013 16:15:27 +0000
From:	"Jan Beulich" <JBeulich@...e.com>
To:	<mingo@...e.hu>, <tglx@...utronix.de>, <hpa@...or.com>
Cc:	<arjan@...ux.intel.com>, <linux@...ck-us.net>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH] x86: override __compiletime_object_size()

As discussed in the context of commits 3df7b41a ("x86: Unify
copy_from_user() size checking") and 7a3d9b0f ("x86: Unify
copy_to_user() and add size checking to it"), we want to leverage
__builtin_object_size() also on newer gcc versions, but with other
architectures still using another model of copy_*_user() verification
we can't replace the global definition. Do it in the (only) header
needing the construct for now.

Signed-off-by: Jan Beulich <jbeulich@...e.com>
Cc: Arjan van de Ven <arjan@...ux.intel.com>
Cc: Guenter Roeck <linux@...ck-us.net>
---
 arch/x86/include/asm/uaccess.h |    6 ++++++
 1 file changed, 6 insertions(+)

--- 3.13-rc1/arch/x86/include/asm/uaccess.h
+++ 3.13-rc1-x86-compiletime-object-size/arch/x86/include/asm/uaccess.h
@@ -584,6 +584,12 @@ __copy_from_user_overflow(int size, unsi
 
 #endif
 
+/* linux/compiler-gcc4.h restricts this to gcc < 4.6, which doesn't suit us. */
+#if defined(__GNUC__) && GCC_VERSION >= 40100
+# undef __compiletime_object_size
+# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
+#endif
+
 static inline unsigned long __must_check
 copy_from_user(void *to, const void __user *from, unsigned long n)
 {



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ