ipc-helper.c: reject invalid SOF_MEM_CAPS_* bits#8850
ipc-helper.c: reject invalid SOF_MEM_CAPS_* bits#8850kv2019i merged 1 commit intothesofproject:mainfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
12aff94 to
9cd5f71
Compare
|
Unrelated "signal overflow!" failure in https://sof-ci.01.org/sofpr/PR8850/build2957/devicetest/index.html?model=MTLP_RVP_NOCODEC&testcase=check-alsabat-headset-playback-997 on 1 unrelated suspend/resume failure in https://sof-ci.01.org/sofpr/PR8850/build2958/devicetest/index.html, everything else green. 1 unrelated failure in https://sof-ci.01.org/sof-pr-viewer/#/build/PR8850/build13640869, every other test is green. |
src/include/ipc/topology.h
Outdated
| #define SOF_MEM_CAPS_EXEC BIT(7) /**< executable */ | ||
| #define SOF_MEM_CAPS_L3 BIT(8) /**< L3 memory */ | ||
|
|
||
| #define SOF_MEM_CAPS_MAX_BIT BIT(8) /**< Used for input validation */ |
There was a problem hiding this comment.
Since this is ABI, its better we make it obvious via an inline comment that MAX_BIT needs to be updated for any new MEM_CAPS addition. I would also define MAX_BIT as CAPS_L3 rather than BIT(8) as this makes it even clearer to anyone reading the code.
There was a problem hiding this comment.
we make it obvious via an inline comment that MAX_BIT needs to be updated for any new MEM_CAPS addition.
Comment added.
I would also define MAX_BIT as CAPS_L3 rather than BIT(8) as this makes it even clearer to anyone reading the code.
I can't do that because I realized v2 12aff94 was buggy, apologies. In v2 I made _MAX equal to the last last valid bit but that is wrong, it would incorrectly reject _MAX + some other BIT. The tests passed anyway because we don't seem to test L3_HEAP.
The comparison must be with the first invalid bit. I confused myself with the name "_MAX", it is a bad name. I just replaced it with _LOWEST_INVALID = max << 1
Fixes lack of SOF_MEM_CAPS_* input validation found in thesofproject#8832 Signed-off-by: Marc Herbert <marc.herbert@intel.com>
9cd5f71 to
10cba1f
Compare
|
Only suspend/resume failures in CAVS https://sof-ci.01.org/sofpr/PR8850/build2989/devicetest/index.html ACE https://sof-ci.01.org/sofpr/PR8850/build2988/devicetest/index.html is all green. |
Fixes lack of SOF_MEM_CAPS_* input validation found in #8832