roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.02k stars 204 forks source link

Slab pool boundary guard #585

Closed nolan-veed closed 9 months ago

nolan-veed commented 9 months ago

Why

For https://github.com/roc-streaming/roc-toolkit/issues/582

What

Testing

gavv commented 9 months ago

Thanks for PR, will review in upcoming days! Android timeout is a known issue, I've restarted CI.

nolan-veed commented 9 months ago

Currently, I put a boundary before and after user the data area. But, it just occurred to me that if the user data area is already padded (max-alignment) - should we also check that for buffer overruns.

gavv commented 9 months ago

Thanks for update!

Here is a small follow-up commit: c25b331b2028918b4dd2c66caec722c88c20e463

It adds name to other panics, and fixes small bug:

if ((flags_ & PoolFlag_PanicOnOverflow) == 1) {

will work only if PoolFlag_PanicOnOverflow is equal to 1, so it's replaced with:

if ((flags_ & PoolFlag_PanicOnOverflow) != 0) {