-
Notifications
You must be signed in to change notification settings - Fork 322
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
[BUG] IPC3: Runtime error due to unsigned offset overflow in string.h during fuzz testing #9768
Comments
tmleman
added
bug
Something isn't working as expected
P2
Critical bugs or normal features
IPC3
labels
Jan 8, 2025
tmleman
added a commit
to tmleman/sof
that referenced
this issue
Jan 8, 2025
This patch addresses an issue in the `memcpy_s` function within the Zephyr RTOS string header. The issue was identified during IPC3 fuzz testing with UndefinedBehaviorSanitizer enabled. Changes include: - Adding `stdint.h` for `uintptr_t` type. - Adding checks to prevent overflow in pointer arithmetic. - Adjusting overlap checks to avoid overflow. These changes ensure that the `memcpy_s` function correctly handles edge cases, preventing undefined behavior due to pointer arithmetic overflow and memory overlap. Fixes thesofproject#9768 Signed-off-by: Tomasz Leman <[email protected]>
This was referenced Jan 8, 2025
tmleman
added a commit
to tmleman/sof
that referenced
this issue
Jan 8, 2025
This patch addresses an issue in the `memcpy_s` function within the Zephyr RTOS string header. The issue was identified during IPC3 fuzz testing with UndefinedBehaviorSanitizer enabled. Changes include: - Adding `stdint.h` for `uintptr_t` type. - Adding checks to prevent overflow in pointer arithmetic. - Adjusting overlap checks to avoid overflow. These changes ensure that the `memcpy_s` function correctly handles edge cases, preventing undefined behavior due to pointer arithmetic overflow and memory overlap. Fixes thesofproject#9768 Signed-off-by: Tomasz Leman <[email protected]>
kv2019i
pushed a commit
to kv2019i/sof
that referenced
this issue
Jan 9, 2025
This patch addresses an issue in the `memcpy_s` function within the Zephyr RTOS string header. The issue was identified during IPC3 fuzz testing with UndefinedBehaviorSanitizer enabled. Changes include: - Adding `stdint.h` for `uintptr_t` type. - Adding checks to prevent overflow in pointer arithmetic. - Adjusting overlap checks to avoid overflow. These changes ensure that the `memcpy_s` function correctly handles edge cases, preventing undefined behavior due to pointer arithmetic overflow and memory overlap. Fixes thesofproject#9768 Signed-off-by: Tomasz Leman <[email protected]> (cherry picked from commit 7d11802) Signed-off-by: Kai Vehmanen <[email protected]>
kv2019i
pushed a commit
that referenced
this issue
Jan 9, 2025
This patch addresses an issue in the `memcpy_s` function within the Zephyr RTOS string header. The issue was identified during IPC3 fuzz testing with UndefinedBehaviorSanitizer enabled. Changes include: - Adding `stdint.h` for `uintptr_t` type. - Adding checks to prevent overflow in pointer arithmetic. - Adjusting overlap checks to avoid overflow. These changes ensure that the `memcpy_s` function correctly handles edge cases, preventing undefined behavior due to pointer arithmetic overflow and memory overlap. Fixes #9768 Signed-off-by: Tomasz Leman <[email protected]> (cherry picked from commit 7d11802) Signed-off-by: Kai Vehmanen <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
A runtime error occurs due to an addition of an unsigned offset that results in an overflow. This was detected using UndefinedBehaviorSanitizer during IPC3 fuzz testing.
Note that this issue does not cover the null pointer dereference, which has been reported previously: #9742.
To Reproduce
Reproduction Rate
The issue occurs consistently during fuzz testing.
Expected behavior
The fuzz testing should complete without causing a runtime error.
Impact
This issue is a showstopper as it prevents the completion of fuzz testing and affects the stability of the IPC3 configuration.
Environment
Screenshots or console output
The text was updated successfully, but these errors were encountered: