-
Notifications
You must be signed in to change notification settings - Fork 349
module adapter: avoid module init crash in case of ipc data invalid #7992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@jsarha @cujomalainey , since #7985 reverted #7830, how about this patch? it also try to exit with 0 size case. |
|
@btian1 I would love to see a more detailed explanation and analysis of the problem this patch is trying to fix. |
there is a issue when src module is called, see #7830, when init_data is NULL, module need exit gracefully, however, seems #7830 have issues, and #7985 reverted, so I submit this try to resolve same issue |
You need to put the explanation in the commit message. When trying to understand the code people usually read commit messages / the code, they won't know about past PR. |
thanks, will do once move pr to open state, currently, it is still Draft, waiting for feedback. |
|
@jsarha can you help/comment here as you have the context. |
I was thinking of similar kind of fix when doing #7830, but I was not sure if there could be some modules out there that did not need any init data. But since IPC3 should be legacy only and no new modules should appear there, I think this should be Ok if it passes our CI. Or is there some untested, but important module out there, that does not need any init data? |
|
Thanks, @jsarha, could you post the origin issue link and the verify steps for origin issue? we can verify first and then decide next steps. |
It was a fuzzer issue, and I do not know how reproduce them, but I can copy-paste a backtrace. But before that, these are security issues that try to prevent malicious messages from crashing the FW. So any check that prevents an error that can happen (or is known to happen) should be good, as long as the check is not too strict and cause other errors. Also, there is already a module specific fix for the case bellow here: #8004 , so there is no need to fix that particular case, but as a generic fix this may solve other issues too. Then again I guess our current standing is to do only the bare minimum for IPC3, so then again maybe this is not needed. And then the backtrace: ================================================================= |
|
And the most detailed explanation of what was the actual problem, can be found here (look neighboring comments too): #7830 (comment) |
|
Thanks, @jsarha , #8004 only resolved src_init fuzzer issue, if there is another module have potential issues, then same issue will happen again. If you check ipc4 part, dst->init_data will always have a valid assignment, ipc3 does not, this patch at least can resolve potential |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@btian1 you still need to explain the change better in the commit message. You're not trying to skip module init, but rather returning an error to not crash in case the IPC data is corrupted for processing modules that have no init data, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is no data a valid part of the spec? If yes then this is invalid
In ipc3 module creation, it is possible that ipc data is invalid or corrupted, in this case, module init may crash. This patch is adding error handling to avoid crash. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
|
SOFCI TEST |
|
Looks ready to go, just need a clean CI run. |
|
SOFCI TEST |
|
On DUT still unavailable, but rest is good https://sof-ci.01.org/sofpr/PR7992/build11414/devicetest/index.html (one system PM fail but these are known). Missing DUTs in https://sof-ci.01.org/sofpr/PR7992/build11415/devicetest/index.html as well, but the available ones pass. Rest of CI jobs are passing, so proceeding with merge. |
In ipc3 module creation, it is possible that ipc data is invalid or corrupted, in this case, module init may crash.
This patch is adding error handling to avoid crash.