gsilvis / silvos

half-baked Silvis OS kernel
MIT License
4 stars 2 forks source link

Fix memory corruption in block allocator. #50

Closed gsilvis closed 7 years ago

gsilvis commented 7 years ago

Indices into the bit array were being calculated incorrectly, and went beyond the end of the array. Sometimes this would extend into a block being used by the system, causing very confusing behavior. Because which blocks are allocated when depends on the exact alignment of the beginning and end of memory, this bug can be very difficult to reproduce.

Add two debug checks that should cause panics if the bug is triggered again, but leave them commented out.

Thank you @cstanfill for debugging this problem!