Ignore:
Timestamp:
Apr 14, 2017, 9:41:36 PM (11 days ago)
Author:
brainslayer
Message:

kernel update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/arch/metag/include/asm/uaccess.h

    r31574 r31859  
    198198#define strlen_user(str) strnlen_user(str, 32767)
    199199
    200 extern unsigned long __must_check __copy_user_zeroing(void *to,
    201                                                       const void __user *from,
    202                                                       unsigned long n);
     200extern unsigned long raw_copy_from_user(void *to, const void __user *from,
     201                                        unsigned long n);
    203202
    204203static inline unsigned long
    205204copy_from_user(void *to, const void __user *from, unsigned long n)
    206205{
     206        unsigned long res = n;
    207207        if (likely(access_ok(VERIFY_READ, from, n)))
    208                 return __copy_user_zeroing(to, from, n);
    209         memset(to, 0, n);
    210         return n;
    211 }
    212 
    213 #define __copy_from_user(to, from, n) __copy_user_zeroing(to, from, n)
     208                res = raw_copy_from_user(to, from, n);
     209        if (unlikely(res))
     210                memset(to + (n - res), 0, res);
     211        return res;
     212}
     213
     214#define __copy_from_user(to, from, n) raw_copy_from_user(to, from, n)
    214215#define __copy_from_user_inatomic __copy_from_user
    215216
Note: See TracChangeset for help on using the changeset viewer.