@@ -320,14 +320,10 @@ bool unwind_next_frame(struct unwind_state *state)
320
320
}
321
321
322
322
/* Get the next frame pointer: */
323
- if (state -> next_bp ) {
324
- next_bp = state -> next_bp ;
325
- state -> next_bp = NULL ;
326
- } else if (state -> regs ) {
323
+ if (state -> regs )
327
324
next_bp = (unsigned long * )state -> regs -> bp ;
328
- } else {
325
+ else
329
326
next_bp = (unsigned long * )READ_ONCE_TASK_STACK (state -> task , * state -> bp );
330
- }
331
327
332
328
/* Move to the next frame if it's safe: */
333
329
if (!update_stack_state (state , next_bp ))
@@ -402,21 +398,6 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
402
398
403
399
bp = get_frame_pointer (task , regs );
404
400
405
- /*
406
- * If we crash with IP==0, the last successfully executed instruction
407
- * was probably an indirect function call with a NULL function pointer.
408
- * That means that SP points into the middle of an incomplete frame:
409
- * *SP is a return pointer, and *(SP-sizeof(unsigned long)) is where we
410
- * would have written a frame pointer if we hadn't crashed.
411
- * Pretend that the frame is complete and that BP points to it, but save
412
- * the real BP so that we can use it when looking for the next frame.
413
- */
414
- if (regs && regs -> ip == 0 &&
415
- (unsigned long * )kernel_stack_pointer (regs ) >= first_frame ) {
416
- state -> next_bp = bp ;
417
- bp = ((unsigned long * )kernel_stack_pointer (regs )) - 1 ;
418
- }
419
-
420
401
/* Initialize stack info and make sure the frame data is accessible: */
421
402
get_stack_info (bp , state -> task , & state -> stack_info ,
422
403
& state -> stack_mask );
@@ -429,7 +410,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
429
410
*/
430
411
while (!unwind_done (state ) &&
431
412
(!on_stack (& state -> stack_info , first_frame , sizeof (long )) ||
432
- ( state -> next_bp == NULL && state -> bp < first_frame ) ))
413
+ state -> bp < first_frame ))
433
414
unwind_next_frame (state );
434
415
}
435
416
EXPORT_SYMBOL_GPL (__unwind_start );
0 commit comments