diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
commit | 1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch) | |
tree | 47da3feee8e263e8c9352c85cf518e624be3c211 /kernel/extable.c | |
parent | 750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff) | |
parent | 8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff) |
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/extable.c')
-rw-r--r-- | kernel/extable.c | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/kernel/extable.c b/kernel/extable.c index 38c2412401a1..9aa1cc41ecf7 100644 --- a/kernel/extable.c +++ b/kernel/extable.c | |||
@@ -102,15 +102,7 @@ int core_kernel_data(unsigned long addr) | |||
102 | 102 | ||
103 | int __kernel_text_address(unsigned long addr) | 103 | int __kernel_text_address(unsigned long addr) |
104 | { | 104 | { |
105 | if (core_kernel_text(addr)) | 105 | if (kernel_text_address(addr)) |
106 | return 1; | ||
107 | if (is_module_text_address(addr)) | ||
108 | return 1; | ||
109 | if (is_ftrace_trampoline(addr)) | ||
110 | return 1; | ||
111 | if (is_kprobe_optinsn_slot(addr) || is_kprobe_insn_slot(addr)) | ||
112 | return 1; | ||
113 | if (is_bpf_text_address(addr)) | ||
114 | return 1; | 106 | return 1; |
115 | /* | 107 | /* |
116 | * There might be init symbols in saved stacktraces. | 108 | * There might be init symbols in saved stacktraces. |
@@ -127,17 +119,42 @@ int __kernel_text_address(unsigned long addr) | |||
127 | 119 | ||
128 | int kernel_text_address(unsigned long addr) | 120 | int kernel_text_address(unsigned long addr) |
129 | { | 121 | { |
122 | bool no_rcu; | ||
123 | int ret = 1; | ||
124 | |||
130 | if (core_kernel_text(addr)) | 125 | if (core_kernel_text(addr)) |
131 | return 1; | 126 | return 1; |
127 | |||
128 | /* | ||
129 | * If a stack dump happens while RCU is not watching, then | ||
130 | * RCU needs to be notified that it requires to start | ||
131 | * watching again. This can happen either by tracing that | ||
132 | * triggers a stack trace, or a WARN() that happens during | ||
133 | * coming back from idle, or cpu on or offlining. | ||
134 | * | ||
135 | * is_module_text_address() as well as the kprobe slots | ||
136 | * and is_bpf_text_address() require RCU to be watching. | ||
137 | */ | ||
138 | no_rcu = !rcu_is_watching(); | ||
139 | |||
140 | /* Treat this like an NMI as it can happen anywhere */ | ||
141 | if (no_rcu) | ||
142 | rcu_nmi_enter(); | ||
143 | |||
132 | if (is_module_text_address(addr)) | 144 | if (is_module_text_address(addr)) |
133 | return 1; | 145 | goto out; |
134 | if (is_ftrace_trampoline(addr)) | 146 | if (is_ftrace_trampoline(addr)) |
135 | return 1; | 147 | goto out; |
136 | if (is_kprobe_optinsn_slot(addr) || is_kprobe_insn_slot(addr)) | 148 | if (is_kprobe_optinsn_slot(addr) || is_kprobe_insn_slot(addr)) |
137 | return 1; | 149 | goto out; |
138 | if (is_bpf_text_address(addr)) | 150 | if (is_bpf_text_address(addr)) |
139 | return 1; | 151 | goto out; |
140 | return 0; | 152 | ret = 0; |
153 | out: | ||
154 | if (no_rcu) | ||
155 | rcu_nmi_exit(); | ||
156 | |||
157 | return ret; | ||
141 | } | 158 | } |
142 | 159 | ||
143 | /* | 160 | /* |