uaccess.h (7fbb8759eff9a348efa5f352ffaa51c364837c4b) | uaccess.h (59f0cb0fddc14ffc6676ae62e911f8115ebc8ccf) |
---|---|
1/* 2 * arch/arm/include/asm/uaccess.h 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 */ 8#ifndef _ASMARM_UACCESS_H --- 386 unchanged lines hidden (view full) --- 395extern unsigned long __must_check __strncpy_from_user(char *to, const char __user *from, unsigned long count); 396extern unsigned long __must_check __strnlen_user(const char __user *s, long n); 397 398static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) 399{ 400 if (access_ok(VERIFY_READ, from, n)) 401 n = __copy_from_user(to, from, n); 402 else /* security hole - plug it */ | 1/* 2 * arch/arm/include/asm/uaccess.h 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 2 as 6 * published by the Free Software Foundation. 7 */ 8#ifndef _ASMARM_UACCESS_H --- 386 unchanged lines hidden (view full) --- 395extern unsigned long __must_check __strncpy_from_user(char *to, const char __user *from, unsigned long count); 396extern unsigned long __must_check __strnlen_user(const char __user *s, long n); 397 398static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n) 399{ 400 if (access_ok(VERIFY_READ, from, n)) 401 n = __copy_from_user(to, from, n); 402 else /* security hole - plug it */ |
403 memzero(to, n); | 403 memset(to, 0, n); |
404 return n; 405} 406 407static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n) 408{ 409 if (access_ok(VERIFY_WRITE, to, n)) 410 n = __copy_to_user(to, from, n); 411 return n; --- 33 unchanged lines hidden --- | 404 return n; 405} 406 407static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n) 408{ 409 if (access_ok(VERIFY_WRITE, to, n)) 410 n = __copy_to_user(to, from, n); 411 return n; --- 33 unchanged lines hidden --- |