Commit abfee9d
Jyri Sarha
schedule: dp: restore the component driver on the error path
scheduler_dp_task_init() keeps its own copy of the component driver
inside task_memory and repoints mod->dev->drv at it:
task_memory->drv = *mod->dev->drv;
mod->dev->drv = &task_memory->drv;
Every error path ends at e_tmem, which releases task_memory, so
mod->dev->drv is left pointing into memory that has just been freed.
Nothing notices until the host tears the pipeline down and the module is
freed for real:
module_free(): ops = mod->dev->drv->adapter_ops
That dereference faults. The module heap is a vregion whose pages are
unmapped when it is released, so the access is rejected by the MMU
rather than quietly returning junk:
** FATAL EXCEPTION
** CPU 2 EXCCAUSE 28 (load prohibited)
** PC 0xa008297f
Backtrace: module_free <- module_adapter_free <- lib_manager_module_free
<- ipc4_delete_pipeline
Remember the original pointer and put it back before task_memory is
freed.
Verified on PTL by reverting the vpage reservation fix to bring back the
partition overlap that makes DP task creation fail: 18 consecutive
failures were reported to the host as errors with no heap corruption, no
exception and no panic, where previously the first one halted the core.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>1 parent 6f92aee commit abfee9d
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| 481 | + | |
| 482 | + | |
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
| |||
643 | 645 | | |
644 | 646 | | |
645 | 647 | | |
| 648 | + | |
| 649 | + | |
646 | 650 | | |
647 | 651 | | |
648 | 652 | | |
| |||
0 commit comments