.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /** |
---|
2 | 3 | * Copyright (C) 2005 Brian Rogan <bcr6@cornell.edu>, IBM |
---|
3 | 4 | * |
---|
4 | | - * This program is free software; you can redistribute it and/or |
---|
5 | | - * modify it under the terms of the GNU General Public License |
---|
6 | | - * as published by the Free Software Foundation; either version |
---|
7 | | - * 2 of the License, or (at your option) any later version. |
---|
8 | 5 | **/ |
---|
9 | 6 | |
---|
10 | | -#include <linux/compat_time.h> |
---|
| 7 | +#include <linux/time.h> |
---|
11 | 8 | #include <linux/oprofile.h> |
---|
12 | 9 | #include <linux/sched.h> |
---|
13 | 10 | #include <asm/processor.h> |
---|
14 | 11 | #include <linux/uaccess.h> |
---|
15 | | -#include <asm/compat.h> |
---|
| 12 | +#include <linux/compat.h> |
---|
16 | 13 | #include <asm/oprofile_impl.h> |
---|
17 | 14 | |
---|
18 | 15 | #define STACK_SP(STACK) *(STACK) |
---|
.. | .. |
---|
31 | 28 | unsigned int stack_frame[2]; |
---|
32 | 29 | void __user *p = compat_ptr(sp); |
---|
33 | 30 | |
---|
34 | | - if (!access_ok(VERIFY_READ, p, sizeof(stack_frame))) |
---|
35 | | - return 0; |
---|
36 | | - |
---|
37 | 31 | /* |
---|
38 | 32 | * The most likely reason for this is that we returned -EFAULT, |
---|
39 | 33 | * which means that we've done all that we can do from |
---|
40 | 34 | * interrupt context. |
---|
41 | 35 | */ |
---|
42 | | - if (__copy_from_user_inatomic(stack_frame, p, sizeof(stack_frame))) |
---|
| 36 | + if (copy_from_user_nofault(stack_frame, (void __user *)p, |
---|
| 37 | + sizeof(stack_frame))) |
---|
43 | 38 | return 0; |
---|
44 | 39 | |
---|
45 | 40 | if (!is_first) |
---|
.. | .. |
---|
57 | 52 | { |
---|
58 | 53 | unsigned long stack_frame[3]; |
---|
59 | 54 | |
---|
60 | | - if (!access_ok(VERIFY_READ, (void __user *)sp, sizeof(stack_frame))) |
---|
61 | | - return 0; |
---|
62 | | - |
---|
63 | | - if (__copy_from_user_inatomic(stack_frame, (void __user *)sp, |
---|
64 | | - sizeof(stack_frame))) |
---|
| 55 | + if (copy_from_user_nofault(stack_frame, (void __user *)sp, |
---|
| 56 | + sizeof(stack_frame))) |
---|
65 | 57 | return 0; |
---|
66 | 58 | |
---|
67 | 59 | if (!is_first) |
---|
.. | .. |
---|
106 | 98 | first_frame = 0; |
---|
107 | 99 | } |
---|
108 | 100 | } else { |
---|
109 | | - pagefault_disable(); |
---|
110 | 101 | #ifdef CONFIG_PPC64 |
---|
111 | 102 | if (!is_32bit_task()) { |
---|
112 | 103 | while (depth--) { |
---|
.. | .. |
---|
115 | 106 | break; |
---|
116 | 107 | first_frame = 0; |
---|
117 | 108 | } |
---|
118 | | - pagefault_enable(); |
---|
119 | 109 | return; |
---|
120 | 110 | } |
---|
121 | 111 | #endif |
---|
.. | .. |
---|
126 | 116 | break; |
---|
127 | 117 | first_frame = 0; |
---|
128 | 118 | } |
---|
129 | | - pagefault_enable(); |
---|
130 | 119 | } |
---|
131 | 120 | } |
---|