diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-23 14:34:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-23 14:34:24 -0400 |
commit | defe9104833b5ad309447bbc1fcb8e5981b2d3e1 (patch) | |
tree | c399f17f5b2dfacbf6df399dd1df8b15c7573fbe /include/asm-generic | |
parent | 95b3692d9c22c659312acb466d0608bf8509f296 (diff) | |
parent | 0634a632f5dea8281ae7c9a96800582ff9eb1475 (diff) |
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()
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/hardirq.h | 13 | ||||
-rw-r--r-- | include/asm-generic/pgtable.h | 4 | ||||
-rw-r--r-- | include/asm-generic/uaccess.h | 14 | ||||
-rw-r--r-- | include/asm-generic/unistd.h | 7 |
4 files changed, 18 insertions, 20 deletions
diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h index 3d5d2c906ab3..23bb4dad4962 100644 --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h | |||
@@ -11,19 +11,6 @@ typedef struct { | |||
11 | 11 | ||
12 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 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 | #ifndef ack_bad_irq | 14 | #ifndef ack_bad_irq |
28 | static inline void ack_bad_irq(unsigned int irq) | 15 | static inline void ack_bad_irq(unsigned int irq) |
29 | { | 16 | { |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index e410f602cab1..e2bd73e8f9c0 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -129,6 +129,10 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
129 | #define move_pte(pte, prot, old_addr, new_addr) (pte) | 129 | #define move_pte(pte, prot, old_addr, new_addr) (pte) |
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | #ifndef pgprot_noncached | ||
133 | #define pgprot_noncached(prot) (prot) | ||
134 | #endif | ||
135 | |||
132 | #ifndef pgprot_writecombine | 136 | #ifndef pgprot_writecombine |
133 | #define pgprot_writecombine pgprot_noncached | 137 | #define pgprot_writecombine pgprot_noncached |
134 | #endif | 138 | #endif |
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h index 6d8cab22e294..b218b8513d04 100644 --- a/include/asm-generic/uaccess.h +++ b/include/asm-generic/uaccess.h | |||
@@ -163,7 +163,7 @@ static inline __must_check long __copy_to_user(void __user *to, | |||
163 | #define put_user(x, ptr) \ | 163 | #define put_user(x, ptr) \ |
164 | ({ \ | 164 | ({ \ |
165 | might_sleep(); \ | 165 | might_sleep(); \ |
166 | __access_ok(ptr, sizeof (*ptr)) ? \ | 166 | access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \ |
167 | __put_user(x, ptr) : \ | 167 | __put_user(x, ptr) : \ |
168 | -EFAULT; \ | 168 | -EFAULT; \ |
169 | }) | 169 | }) |
@@ -219,7 +219,7 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
219 | #define get_user(x, ptr) \ | 219 | #define get_user(x, ptr) \ |
220 | ({ \ | 220 | ({ \ |
221 | might_sleep(); \ | 221 | might_sleep(); \ |
222 | __access_ok(ptr, sizeof (*ptr)) ? \ | 222 | access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ |
223 | __get_user(x, ptr) : \ | 223 | __get_user(x, ptr) : \ |
224 | -EFAULT; \ | 224 | -EFAULT; \ |
225 | }) | 225 | }) |
@@ -244,7 +244,7 @@ static inline long copy_from_user(void *to, | |||
244 | const void __user * from, unsigned long n) | 244 | const void __user * from, unsigned long n) |
245 | { | 245 | { |
246 | might_sleep(); | 246 | might_sleep(); |
247 | if (__access_ok(from, n)) | 247 | if (access_ok(VERIFY_READ, from, n)) |
248 | return __copy_from_user(to, from, n); | 248 | return __copy_from_user(to, from, n); |
249 | else | 249 | else |
250 | return n; | 250 | return n; |
@@ -254,7 +254,7 @@ static inline long copy_to_user(void __user *to, | |||
254 | const void *from, unsigned long n) | 254 | const void *from, unsigned long n) |
255 | { | 255 | { |
256 | might_sleep(); | 256 | might_sleep(); |
257 | if (__access_ok(to, n)) | 257 | if (access_ok(VERIFY_WRITE, to, n)) |
258 | return __copy_to_user(to, from, n); | 258 | return __copy_to_user(to, from, n); |
259 | else | 259 | else |
260 | return n; | 260 | return n; |
@@ -278,7 +278,7 @@ __strncpy_from_user(char *dst, const char __user *src, long count) | |||
278 | static inline long | 278 | static inline long |
279 | strncpy_from_user(char *dst, const char __user *src, long count) | 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 | return -EFAULT; | 282 | return -EFAULT; |
283 | return __strncpy_from_user(dst, src, count); | 283 | return __strncpy_from_user(dst, src, count); |
284 | } | 284 | } |
@@ -291,6 +291,8 @@ strncpy_from_user(char *dst, const char __user *src, long count) | |||
291 | #ifndef strnlen_user | 291 | #ifndef strnlen_user |
292 | static inline long strnlen_user(const char __user *src, long n) | 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 | return strlen((void * __force)src) + 1; | 296 | return strlen((void * __force)src) + 1; |
295 | } | 297 | } |
296 | #endif | 298 | #endif |
@@ -316,7 +318,7 @@ static inline __must_check unsigned long | |||
316 | clear_user(void __user *to, unsigned long n) | 318 | clear_user(void __user *to, unsigned long n) |
317 | { | 319 | { |
318 | might_sleep(); | 320 | might_sleep(); |
319 | if (!__access_ok(to, n)) | 321 | if (!access_ok(VERIFY_WRITE, to, n)) |
320 | return n; | 322 | return n; |
321 | 323 | ||
322 | return __clear_user(to, n); | 324 | return __clear_user(to, n); |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index 5b34b6233d6d..1125e5a1ee5d 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -618,8 +618,13 @@ __SYSCALL(__NR_migrate_pages, sys_migrate_pages) | |||
618 | __SYSCALL(__NR_move_pages, sys_move_pages) | 618 | __SYSCALL(__NR_move_pages, sys_move_pages) |
619 | #endif | 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 | #undef __NR_syscalls | 626 | #undef __NR_syscalls |
622 | #define __NR_syscalls 240 | 627 | #define __NR_syscalls 242 |
623 | 628 | ||
624 | /* | 629 | /* |
625 | * All syscalls below here should go away really, | 630 | * All syscalls below here should go away really, |