From: Alex Shi Date: Wed, 5 Oct 2016 11:21:50 +0000 (+0200) Subject: Merge remote-tracking branch 'lts/linux-4.4.y' into linux-linaro-lsk-v4.4 X-Git-Tag: firefly_0821_release~176^2~4^2~28 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=10fd238c91a8dd2fb9c9bce99eb4d357254fb3c6;p=firefly-linux-kernel-4.4.55.git Merge remote-tracking branch 'lts/linux-4.4.y' into linux-linaro-lsk-v4.4 Conflicts: resovle the conflict on pax_copy for arch/ia64/include/asm/uaccess.h arch/powerpc/include/asm/uaccess.h arch/sparc/include/asm/uaccess_32.h --- 10fd238c91a8dd2fb9c9bce99eb4d357254fb3c6 diff --cc arch/powerpc/include/asm/uaccess.h index 4181f1023508,a5ffe0207c16..db71448b9bb9 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@@ -323,36 -323,17 +323,21 @@@ extern unsigned long __copy_tofrom_user static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) { - unsigned long over; - - if (access_ok(VERIFY_READ, from, n)) { - if (likely(access_ok(VERIFY_READ, from, n))) ++ if (likely(access_ok(VERIFY_READ, from, n))) { + check_object_size(to, n, false); return __copy_tofrom_user((__force void __user *)to, from, n); + } - if ((unsigned long)from < TASK_SIZE) { - over = (unsigned long)from + n - TASK_SIZE; - check_object_size(to, n - over, false); - return __copy_tofrom_user((__force void __user *)to, from, - n - over) + over; - } + memset(to, 0, n); return n; } static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) { - unsigned long over; - - if (access_ok(VERIFY_WRITE, to, n)) + if (access_ok(VERIFY_WRITE, to, n)) { + check_object_size(from, n, true); return __copy_tofrom_user(to, (__force void __user *)from, n); + } - if ((unsigned long)to < TASK_SIZE) { - over = (unsigned long)to + n - TASK_SIZE; - check_object_size(from, n - over, true); - return __copy_tofrom_user(to, (__force void __user *)from, - n - over) + over; - } return n; } diff --cc arch/sparc/include/asm/uaccess_32.h index e1b6ae3ccdff,dfb542c7cc71..e7d6bb4cd619 --- a/arch/sparc/include/asm/uaccess_32.h +++ b/arch/sparc/include/asm/uaccess_32.h @@@ -328,11 -326,12 +328,13 @@@ static inline unsigned long __copy_to_u static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) { - if (n && __access_ok((unsigned long) from, n)) + if (n && __access_ok((unsigned long) from, n)) { + check_object_size(to, n, false); return __copy_user((__force void __user *) to, from, n); - } else + else { + memset(to, 0, n); return n; + } } static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)