 2922585b93
			
		
	
	
	2922585b93
	
	
	
		
			
			To use this, an architecture simply needs to: 1) Provide a user_addr_max() implementation via asm/uaccess.h 2) Add "select GENERIC_STRNCPY_FROM_USER" to their arch Kcnfig 3) Remove the existing strncpy_from_user() implementation and symbol exports their architecture had. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: David Howells <dhowells@redhat.com>
		
			
				
	
	
		
			9 lines
		
	
	
	
		
			196 B
			
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			9 lines
		
	
	
	
		
			196 B
			
		
	
	
	
		
			C
		
	
	
	
	
	
| #include <linux/module.h>
 | |
| #include <linux/kernel.h>
 | |
| #include <linux/bug.h>
 | |
| 
 | |
| void copy_from_user_overflow(void)
 | |
| {
 | |
| 	WARN(1, "Buffer overflow detected!\n");
 | |
| }
 | |
| EXPORT_SYMBOL(copy_from_user_overflow);
 |