Commit e04a28d
committed
arm64: debug: re-enable irqs before sending breakpoint SIGTRAP
force_sig_info can sleep under an -rt kernel, so attempting to send a
breakpoint SIGTRAP with interrupts disabled yields the following BUG:
BUG: sleeping function called from invalid context at
/kernel-source/kernel/locking/rtmutex.c:917
in_atomic(): 0, irqs_disabled(): 128, pid: 551, name: test.sh
CPU: 5 PID: 551 Comm: test.sh Not tainted 4.1.13-rt13 #7
Hardware name: Freescale Layerscape 2085a RDB Board (DT)
Call trace:
dump_backtrace+0x0/0x128
show_stack+0x24/0x30
dump_stack+0x80/0xa0
___might_sleep+0x128/0x1a0
rt_spin_lock+0x2c/0x40
force_sig_info+0xcc/0x210
brk_handler.part.2+0x6c/0x80
brk_handler+0xd8/0xe8
do_debug_exception+0x58/0xb8
This patch fixes the problem by ensuring that interrupts are enabled
prior to sending the SIGTRAP if they were already enabled in the user
context.
Reported-by: Yang Shi <[email protected]>
Signed-off-by: Will Deacon <[email protected]>1 parent bcaf669 commit e04a28d
1 file changed
+22
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
229 | 248 | | |
230 | 249 | | |
231 | 250 | | |
232 | | - | |
233 | | - | |
234 | 251 | | |
235 | 252 | | |
236 | 253 | | |
| |||
239 | 256 | | |
240 | 257 | | |
241 | 258 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 259 | + | |
247 | 260 | | |
248 | 261 | | |
249 | 262 | | |
| |||
307 | 320 | | |
308 | 321 | | |
309 | 322 | | |
310 | | - | |
311 | | - | |
312 | 323 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 324 | + | |
321 | 325 | | |
322 | 326 | | |
323 | 327 | | |
| |||
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
331 | | - | |
332 | 335 | | |
333 | 336 | | |
334 | 337 | | |
| |||
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 365 | + | |
370 | 366 | | |
371 | 367 | | |
372 | 368 | | |
| |||
0 commit comments