Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
asm-generic: add dummy pgprot_noncached()
lib/checksum.c: fix endianess bug
asm-generic: hook up new system calls
asm-generic: list Arnd as asm-generic maintainer
asm-generic: drop HARDIRQ_BITS definition from hardirq.h
asm-generic: uaccess: fix up local access_ok() usage
asm-generic: uaccess: add missing access_ok() check to strnlen_user()

+35 -21
+8
MAINTAINERS
··· 2482 2482 F: drivers/net/wan/pci200syn.c 2483 2483 F: drivers/net/wan/wanxl* 2484 2484 2485 + GENERIC INCLUDE/ASM HEADER FILES 2486 + P: Arnd Bergmann 2487 + M: arnd@arndb.de 2488 + L: linux-arch@vger.kernel.org 2489 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 2490 + S: Maintained 2491 + F: include/asm-generic 2492 + 2485 2493 GFS2 FILE SYSTEM 2486 2494 P: Steven Whitehouse 2487 2495 M: swhiteho@redhat.com
-13
include/asm-generic/hardirq.h
··· 11 11 12 12 #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 13 13 14 - #ifndef HARDIRQ_BITS 15 - #define HARDIRQ_BITS 8 16 - #endif 17 - 18 - /* 19 - * The hardirq mask has to be large enough to have 20 - * space for potentially all IRQ sources in the system 21 - * nesting on a single CPU: 22 - */ 23 - #if (1 << HARDIRQ_BITS) < NR_IRQS 24 - # error HARDIRQ_BITS is too low! 25 - #endif 26 - 27 14 #ifndef ack_bad_irq 28 15 static inline void ack_bad_irq(unsigned int irq) 29 16 {
+4
include/asm-generic/pgtable.h
··· 129 129 #define move_pte(pte, prot, old_addr, new_addr) (pte) 130 130 #endif 131 131 132 + #ifndef pgprot_noncached 133 + #define pgprot_noncached(prot) (prot) 134 + #endif 135 + 132 136 #ifndef pgprot_writecombine 133 137 #define pgprot_writecombine pgprot_noncached 134 138 #endif
+8 -6
include/asm-generic/uaccess.h
··· 163 163 #define put_user(x, ptr) \ 164 164 ({ \ 165 165 might_sleep(); \ 166 - __access_ok(ptr, sizeof (*ptr)) ? \ 166 + access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \ 167 167 __put_user(x, ptr) : \ 168 168 -EFAULT; \ 169 169 }) ··· 219 219 #define get_user(x, ptr) \ 220 220 ({ \ 221 221 might_sleep(); \ 222 - __access_ok(ptr, sizeof (*ptr)) ? \ 222 + access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ 223 223 __get_user(x, ptr) : \ 224 224 -EFAULT; \ 225 225 }) ··· 244 244 const void __user * from, unsigned long n) 245 245 { 246 246 might_sleep(); 247 - if (__access_ok(from, n)) 247 + if (access_ok(VERIFY_READ, from, n)) 248 248 return __copy_from_user(to, from, n); 249 249 else 250 250 return n; ··· 254 254 const void *from, unsigned long n) 255 255 { 256 256 might_sleep(); 257 - if (__access_ok(to, n)) 257 + if (access_ok(VERIFY_WRITE, to, n)) 258 258 return __copy_to_user(to, from, n); 259 259 else 260 260 return n; ··· 278 278 static inline long 279 279 strncpy_from_user(char *dst, const char __user *src, long count) 280 280 { 281 - if (!__access_ok(src, 1)) 281 + if (!access_ok(VERIFY_READ, src, 1)) 282 282 return -EFAULT; 283 283 return __strncpy_from_user(dst, src, count); 284 284 } ··· 291 291 #ifndef strnlen_user 292 292 static inline long strnlen_user(const char __user *src, long n) 293 293 { 294 + if (!access_ok(VERIFY_READ, src, 1)) 295 + return 0; 294 296 return strlen((void * __force)src) + 1; 295 297 } 296 298 #endif ··· 318 316 clear_user(void __user *to, unsigned long n) 319 317 { 320 318 might_sleep(); 321 - if (!__access_ok(to, n)) 319 + if (!access_ok(VERIFY_WRITE, to, n)) 322 320 return n; 323 321 324 322 return __clear_user(to, n);
+6 -1
include/asm-generic/unistd.h
··· 618 618 __SYSCALL(__NR_move_pages, sys_move_pages) 619 619 #endif 620 620 621 + #define __NR_rt_tgsigqueueinfo 240 622 + __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) 623 + #define __NR_perf_counter_open 241 624 + __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) 625 + 621 626 #undef __NR_syscalls 622 - #define __NR_syscalls 240 627 + #define __NR_syscalls 242 623 628 624 629 /* 625 630 * All syscalls below here should go away really,
+9 -1
lib/checksum.c
··· 55 55 goto out; 56 56 odd = 1 & (unsigned long) buff; 57 57 if (odd) { 58 + #ifdef __LITTLE_ENDIAN 58 59 result = *buff; 60 + #else 61 + result += (*buff << 8); 62 + #endif 59 63 len--; 60 64 buff++; 61 65 } ··· 75 71 if (count) { 76 72 unsigned long carry = 0; 77 73 do { 78 - unsigned long w = *(unsigned long *) buff; 74 + unsigned long w = *(unsigned int *) buff; 79 75 count--; 80 76 buff += 4; 81 77 result += carry; ··· 91 87 } 92 88 } 93 89 if (len & 1) 90 + #ifdef __LITTLE_ENDIAN 91 + result += *buff; 92 + #else 94 93 result += (*buff << 8); 94 + #endif 95 95 result = from32to16(result); 96 96 if (odd) 97 97 result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);