Unix backtrace call detection

If the supposed return address is a pointer to the beginning of an
executable page, and the page before is an oversized file mapping,
like vvar before vdso, the backtrace would be terminated by SIGBUS.

To avoid this, check not for readable, but for executable instead.
This commit is contained in:
Arusekk
2020-06-17 10:04:54 +02:00
parent 56caf6da4b
commit 46f3e8aa9d
+1 -2
View File
@@ -236,8 +236,7 @@ static bool PointsToValidCall( const void *ptr )
int len = 7;
while( len )
{
int val = find_address( buf-len, g_ReadableBegin, g_ReadableEnd );
if( val != -1 )
if( IsExecutableAddress( buf - len ) )
break;
--len;
}