• R/O
  • HTTP
  • SSH
  • HTTPS

tomoyo-test1: 提交

This is a test repository.


Commit MetaInfo

修订版38696e33e2bdf91cbbc7a2291dc6db862d9dfd42 (tree)
时间2020-06-04 06:01:23
作者Linus Torvalds <torvalds@linu...>
CommiterLinus Torvalds

Log Message

Xtensa updates for v5.8:

- fix user annotations in asm/uaccess.h
- fix comments in entry.S
-----BEGIN PGP SIGNATURE-----

iQJHBAABCgAxFiEEK2eFS5jlMn3N6xfYUfnMkfg/oEQFAl7XawcTHGpjbXZia2Jj
QGdtYWlsLmNvbQAKCRBR+cyR+D+gRHnJD/4g36b1hvtF+fLFua6twLlkoW1Iw4Gx
s7rKD/goY6XgqZYMhfzkNH/2Net8OLVTVn5aAGb1sa07LznMXxT7UyMLKBHbX4Em
lojApNeMnPGLCija9yHU4rD+vWN4NOb+gxyZYCoQ91A+cqX1Sobm8JSYcnGG81qz
+lMgGoz0Sr1GEupkSA8PxVHp+DqhZFu4yCKcKvHO26ic61bZbnmwnpm/9Qkrvg0W
E55yG0I4aAF5OraC0nkSLMieEIf0pZPujrtLAszegRqubzVM1ZSNntc3OPMcvc+s
iyZdX9ppM3ozmFr7x8BXMUIw5aN4fyxKY9QTHKVRqOzeRYSnqtw9+sRWooLgOliS
eJe/cXI5Y7rLrHIG7gV/u0x7WkPQOHtW2KvEYG3KkHpm35ZcRdItu1tDaGX6t8pm
KK2GDyNcY5uqN6agMdNtw8hJm5SBKwvMIdg6kLoJEht0OPe0BbIvSyweBU61dM+q
CpprzVC/DStOXrZn3g46jkfNhO66JRnulJKlu2LWFAovwsZfTqeb307d750JGwKn
odOXEXGYBZViMurxYyM/+VBJHeh9yLYlYtT8IiGMTHqYTMgZScDfFsgPvsdQDS3P
yJeRA7pJwvOIQvG6HZ7FaFmrAhfFy16rk2L7B9MYeB6qcc5z8VgjaWcQXBY3eM8R
tmbAxwtqwugJpA==
=NfM2
-----END PGP SIGNATURE-----

Merge tag 'xtensa-20200603' of git://github.com/jcmvbkbc/linux-xtensa

Pull Xtensa updates from Max Filippov:

- fix user annotations in asm/uaccess.h
- fix comments in entry.S

* tag 'xtensa-20200603' of git://github.com/jcmvbkbc/linux-xtensa:

xtensa: Fix spelling/grammar in comment
xtensa: add missing user annotations to asm/uaccess.h
xtensa: fix error paths in
get_user_{check,size}
xtensa: fix type conversion in get_user_size
xtensa: add missing
user annotations to {get,put}_user_check

更改概述

差异

--- a/arch/xtensa/include/asm/uaccess.h
+++ b/arch/xtensa/include/asm/uaccess.h
@@ -84,7 +84,7 @@ extern long __put_user_bad(void);
8484 #define __put_user_check(x, ptr, size) \
8585 ({ \
8686 long __pu_err = -EFAULT; \
87- __typeof__(*(ptr)) *__pu_addr = (ptr); \
87+ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
8888 if (access_ok(__pu_addr, size)) \
8989 __put_user_size((x), __pu_addr, (size), __pu_err); \
9090 __pu_err; \
@@ -180,11 +180,11 @@ __asm__ __volatile__( \
180180 #define __get_user_check(x, ptr, size) \
181181 ({ \
182182 long __gu_err = -EFAULT; \
183- const __typeof__(*(ptr)) *__gu_addr = (ptr); \
183+ const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
184184 if (access_ok(__gu_addr, size)) \
185185 __get_user_size((x), __gu_addr, (size), __gu_err); \
186186 else \
187- (x) = 0; \
187+ (x) = (__typeof__(*(ptr)))0; \
188188 __gu_err; \
189189 })
190190
@@ -202,13 +202,15 @@ do { \
202202 u64 __x; \
203203 if (unlikely(__copy_from_user(&__x, ptr, 8))) { \
204204 retval = -EFAULT; \
205- (x) = 0; \
205+ (x) = (__typeof__(*(ptr)))0; \
206206 } else { \
207- (x) = *(__force __typeof__((ptr)))&__x; \
207+ (x) = *(__force __typeof__(*(ptr)) *)&__x; \
208208 } \
209209 break; \
210210 } \
211- default: (x) = 0; __get_user_bad(); \
211+ default: \
212+ (x) = (__typeof__(*(ptr)))0; \
213+ __get_user_bad(); \
212214 } \
213215 } while (0)
214216
@@ -270,15 +272,15 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
270272 */
271273
272274 static inline unsigned long
273-__xtensa_clear_user(void *addr, unsigned long size)
275+__xtensa_clear_user(void __user *addr, unsigned long size)
274276 {
275- if (!__memset(addr, 0, size))
277+ if (!__memset((void __force *)addr, 0, size))
276278 return size;
277279 return 0;
278280 }
279281
280282 static inline unsigned long
281-clear_user(void *addr, unsigned long size)
283+clear_user(void __user *addr, unsigned long size)
282284 {
283285 if (access_ok(addr, size))
284286 return __xtensa_clear_user(addr, size);
@@ -290,10 +292,10 @@ clear_user(void *addr, unsigned long size)
290292
291293 #ifndef CONFIG_GENERIC_STRNCPY_FROM_USER
292294
293-extern long __strncpy_user(char *, const char *, long);
295+extern long __strncpy_user(char *dst, const char __user *src, long count);
294296
295297 static inline long
296-strncpy_from_user(char *dst, const char *src, long count)
298+strncpy_from_user(char *dst, const char __user *src, long count)
297299 {
298300 if (access_ok(src, 1))
299301 return __strncpy_user(dst, src, count);
@@ -306,13 +308,11 @@ long strncpy_from_user(char *dst, const char *src, long count);
306308 /*
307309 * Return the size of a string (including the ending 0!)
308310 */
309-extern long __strnlen_user(const char *, long);
311+extern long __strnlen_user(const char __user *str, long len);
310312
311-static inline long strnlen_user(const char *str, long len)
313+static inline long strnlen_user(const char __user *str, long len)
312314 {
313- unsigned long top = __kernel_ok ? ~0UL : TASK_SIZE - 1;
314-
315- if ((unsigned long)str > top)
315+ if (!access_ok(str, 1))
316316 return 0;
317317 return __strnlen_user(str, len);
318318 }
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -959,14 +959,14 @@ ENDPROC(unrecoverable_exception)
959959 * of the proper size instead.
960960 *
961961 * This algorithm simply backs out the register changes started by the user
962- * excpetion handler, makes it appear that we have started a window underflow
962+ * exception handler, makes it appear that we have started a window underflow
963963 * by rotating the window back and then setting the old window base (OWB) in
964964 * the 'ps' register with the rolled back window base. The 'movsp' instruction
965965 * will be re-executed and this time since the next window frames is in the
966966 * active AR registers it won't cause an exception.
967967 *
968968 * If the WindowUnderflow code gets a TLB miss the page will get mapped
969- * the the partial windeowUnderflow will be handeled in the double exception
969+ * the partial WindowUnderflow will be handled in the double exception
970970 * handler.
971971 *
972972 * Entry condition:
Show on old repository browser