sparc: Use __builtin_object_size() to validate the buffer size for copy_from_user()

This mirrors x86 commit 9f0cf4adb6
(x86: Use __builtin_object_size() to validate the buffer size for copy_from_user())

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2009-12-10 23:05:23 -08:00
parent 4ed5d5e429
commit fb34035e7b
5 changed files with 56 additions and 3 deletions

View File

@ -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);