linux/arch
Arjan van de Ven 9f0cf4adb6 x86: Use __builtin_object_size() to validate the buffer size for copy_from_user()
gcc (4.x) supports the __builtin_object_size() builtin, which
reports the size of an object that a pointer point to, when known
at compile time. If the buffer size is not known at compile time, a
constant -1 is returned.

This patch uses this feature to add a sanity check to
copy_from_user(); if the target buffer is known to be smaller than
the copy size, the copy is aborted and a WARNing is emitted in
memory debug mode.

These extra checks compile away when the object size is not known,
or if both the buffer size and the copy length are constants.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
LKML-Reference: <20090926143301.2c396b94@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-26 16:25:41 +02:00
..
alpha alpha: convert to asm-generic/hardirq.h 2009-09-22 07:17:43 -07:00
arm Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 2009-09-23 11:25:16 -07:00
avr32 mm: remove duplicate asm/mman.h files 2009-09-22 07:17:42 -07:00
blackfin Blackfin: override text/data checking functions 2009-09-23 07:39:32 -07:00
cris mm: remove duplicate asm/mman.h files 2009-09-22 07:17:42 -07:00
frv FRV: Use asm/generic-hardirq.h 2009-09-23 10:15:21 -07:00
h8300 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-09-22 07:51:45 -07:00
ia64 Merge git://git.infradead.org/iommu-2.6 2009-09-23 10:06:10 -07:00
m32r m32r: convert to asm-generic/hardirq.h 2009-09-22 07:17:43 -07:00
m68k m68k: convert to asm-generic/hardirq.h 2009-09-22 07:17:44 -07:00
m68knommu perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
microblaze arches: drop superfluous casts in nr_free_pages() callers 2009-09-22 07:17:34 -07:00
mips kcore: use registerd physmem information 2009-09-23 07:39:41 -07:00
mn10300 MN10300: Handle removal of struct uart_info 2009-09-23 10:15:21 -07:00
parisc mm: add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions 2009-09-22 07:17:41 -07:00
powerpc Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-09-23 09:46:15 -07:00
s390 Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 2009-09-23 10:02:14 -07:00
score score: Cleanup linker script using new macros. 2009-09-23 13:41:15 +08:00
sh kcore: use registerd physmem information 2009-09-23 07:39:41 -07:00
sparc BUILD_BUG_ON(): fix it and a couple of bogus uses of it 2009-09-23 07:39:29 -07:00
um Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-09-22 07:51:45 -07:00
x86 x86: Use __builtin_object_size() to validate the buffer size for copy_from_user() 2009-09-26 16:25:41 +02:00
xtensa mm: add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions 2009-09-22 07:17:41 -07:00
.gitignore
Kconfig oprofile: fix oprofile regression: select RING_BUFFER_ALLOW_SWAP 2009-09-17 15:53:42 -04:00