You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid infinite loops when iterating macho regions (#2145)
There was a possible (and trivial to trigger) infinite loop in yara that can be caused by quiting an application while we're enumerating its memory regions. When this happens, vm_region_64 will start returning an error (that isn't KERN_INVALID_ADDRESS), which yr_process_get_next_memory_block reacted to by infinite looping.
Generally speaking, the loop in that function seems completely unnecessary, and as such was removed to make the control flow easier to reason about.
This can be reproduced easily by running sudo yara test.yar <pid> on a large application, and quitting the app while the scan is running. This isn't 100% consistent, but more often than not I would end up with the infinite loop.
0 commit comments