Skip to content
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

Fix memory corruption in AVX-512 codepath #6

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

cgutman
Copy link
Contributor

@cgutman cgutman commented Jul 11, 2024

The AVX-512 codepath incorrectly calculates the end of the caller's buffer using sizeof(__m256i) but the elements being processed are actually sizeof(__m512i).

As a result, reed_solomon_encode() and reed_solomon_decode() may write outside the bounds of the caller's buffer for certain block sizes when compiled with AVX-512 optimizations enabled.

This was originally reported in LizardByte/Sunshine#2543

If the block size is not divisible by 64, we could overrun the buffer.
Copy link
Owner

@sleepybishop sleepybishop left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@sleepybishop sleepybishop merged commit 19f07b5 into sleepybishop:master Jul 11, 2024
1 check passed
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.

2 participants