Skip to content

Conversation

@barry-waves
Copy link
Contributor

Enhance payload corruption handling by verifying size

index += param->size;
}

return ret;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return 0

@johnylin76
Copy link
Contributor

Hi @lyakh,
at the same time I would like to ask about the retcode of get_data in module_adapter: https://github.com/thesofproject/sof/blob/main/src/audio/module_adapter/module_adapter_ipc4.c#L162

I wonder if module_adapter should return non-zero error code when interface->get_configuration does not support?
In the present design it returns 0 while not supported, leading to the consequence that the host side will consider get_data successful, but the data obtained is unpredictable.

@barry-waves barry-waves force-pushed the main branch 2 times, most recently from 3230e27 to 71bc7a7 Compare April 11, 2024 05:53
@lyakh
Copy link
Collaborator

lyakh commented Apr 11, 2024

Hi @lyakh, at the same time I would like to ask about the retcode of get_data in module_adapter: https://github.com/thesofproject/sof/blob/main/src/audio/module_adapter/module_adapter_ipc4.c#L162

I wonder if module_adapter should return non-zero error code when interface->get_configuration does not support? In the present design it returns 0 while not supported, leading to the consequence that the host side will consider get_data successful, but the data obtained is unpredictable.

@johnylin76 that's a good point! All the more that calling ops.get_large_config() in handler.c anyway returns the same error whether the method is absent or it failed

ret = IPC4_MOD_INVALID_ID;
Could you submit a fix?

       allocated memory in waves.c

    Enhance payload corruption handling by verifying size
    and make sure to have clean buffer before using it.

Signed-off-by: barry.jan <barry.jan@waves.com>
@barry-waves barry-waves requested a review from Zames-Chang April 11, 2024 09:43
@barry-waves barry-waves changed the title waves: verify payload size in waves.c waves: verify payload size and initialize memory to zero to the allocated memory in waves.c Apr 11, 2024
Copy link
Contributor

@johnylin76 johnylin76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@johnylin76
Copy link
Contributor

Hi @lyakh, at the same time I would like to ask about the retcode of get_data in module_adapter: https://github.com/thesofproject/sof/blob/main/src/audio/module_adapter/module_adapter_ipc4.c#L162
I wonder if module_adapter should return non-zero error code when interface->get_configuration does not support? In the present design it returns 0 while not supported, leading to the consequence that the host side will consider get_data successful, but the data obtained is unpredictable.

@johnylin76 that's a good point! All the more that calling ops.get_large_config() in handler.c anyway returns the same error whether the method is absent or it failed

ret = IPC4_MOD_INVALID_ID;

Could you submit a fix?

Thanks. I will provide that in the other PR afterwards.

@lgirdwood lgirdwood merged commit 355e46f into thesofproject:main Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants