diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-10 23:05:23 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-10 23:05:23 -0800 |
commit | fb34035e7b4bb3edc7c2dc0683cfe21f57a9574d (patch) | |
tree | ddde17e5690d77f4f61c6271fc8b6f520c746851 /arch/sparc/lib | |
parent | 4ed5d5e4299f42438dd5ac6dcb1f2168ea4fb02a (diff) | |
download | linux-fb34035e7b4bb3edc7c2dc0683cfe21f57a9574d.tar.gz linux-fb34035e7b4bb3edc7c2dc0683cfe21f57a9574d.tar.bz2 linux-fb34035e7b4bb3edc7c2dc0683cfe21f57a9574d.zip |
sparc: Use __builtin_object_size() to validate the buffer size for copy_from_user()
This mirrors x86 commit 9f0cf4adb6aa0bfccf675c938124e68f7f06349d
(x86: Use __builtin_object_size() to validate the buffer size for copy_from_user())
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/lib')
-rw-r--r-- | arch/sparc/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/sparc/lib/usercopy.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index e75faf0e59ae..c4b5e03af115 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile @@ -44,3 +44,4 @@ obj-y += iomap.o obj-$(CONFIG_SPARC32) += atomic32.o obj-y += ksyms.o obj-$(CONFIG_SPARC64) += PeeCeeI.o +obj-y += usercopy.o diff --git a/arch/sparc/lib/usercopy.c b/arch/sparc/lib/usercopy.c new file mode 100644 index 000000000000..14b363fec8a2 --- /dev/null +++ b/arch/sparc/lib/usercopy.c @@ -0,0 +1,8 @@ +#include <linux/module.h> +#include <linux/bug.h> + +void copy_from_user_overflow(void) +{ + WARN(1, "Buffer overflow detected!\n"); +} +EXPORT_SYMBOL(copy_from_user_overflow); |