Delete ASAN

It hasn't been helpful enough to be justify the maintenance burden. What
actually does help is mprotect(), kprintf(), --ftrace and --strace which
can always be counted upon to work correctly. We aren't losing much with
this change. Support for ASAN on AARCH64 was never implemented. Applying
ASAN to the core libc runtimes was disabled many months ago. If there is
some way to have an ASAN runtime for user programs that is less invasive
we can potentially consider reintroducing support. But now is premature.
This commit is contained in:
Justine Tunney 2024-06-22 05:45:49 -07:00
parent 6ffed14b9c
commit d1d4388201
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
198 changed files with 130 additions and 2954 deletions

View file

@ -16,7 +16,6 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/asan.internal.h"
#include "libc/nexgen32e/x86feature.h"
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
@ -411,8 +410,6 @@ int mbedtls_p384_double_jac( const mbedtls_ecp_group *G,
{
int ret;
uint64_t T[4][12];
if( IsAsan() ) __asan_verify( P, sizeof( *P ) );
if( IsAsan() ) __asan_verify( R, sizeof( *R ) );
if( ( ret = mbedtls_p384_dim( R ) ) ) return( ret );
if( ( ret = mbedtls_p384_dim( (void *)P ) ) ) return( ret );
mbedtls_platform_zeroize( T, sizeof( T ) );
@ -453,10 +450,6 @@ int mbedtls_p384_add_mixed( const mbedtls_ecp_group *G,
uint64_t T1[12], T2[12], T3[12], T4[12];
size_t Xn, Yn, Zn, QXn, QYn;
} s;
if( IsAsan() ) __asan_verify( G, sizeof( *G ) );
if( IsAsan() ) __asan_verify( P, sizeof( *P ) );
if( IsAsan() ) __asan_verify( Q, sizeof( *Q ) );
if( IsAsan() ) __asan_verify( R, sizeof( *R ) );
if( ( ret = mbedtls_p384_dim( R ) ) ) return( ret );
mbedtls_platform_zeroize( &s, sizeof( s ) );
s.Xn = mbedtls_mpi_limbs( &P->X );

View file

@ -16,7 +16,6 @@
limitations under the License.
*/
#include "third_party/mbedtls/sha1.h"
#include "libc/intrin/asan.internal.h"
#include "libc/serialize.h"
#include "libc/macros.internal.h"
#include "libc/nexgen32e/sha.h"
@ -111,11 +110,6 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx,
if( X86_HAVE( SHA ) )
{
if( IsAsan() )
{
__asan_verify( data, 64 );
__asan_verify( ctx, sizeof(*ctx) );
}
sha1_transform_ni( ctx->state, data, 1 );
return( 0 );
}
@ -123,11 +117,6 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx,
X86_HAVE( BMI2 ) &&
X86_HAVE( AVX2 ) )
{
if( IsAsan() )
{
__asan_verify( data, 64 );
__asan_verify( ctx, sizeof(*ctx) );
}
sha1_transform_avx2( ctx->state, data, 1 );
return( 0 );
}
@ -406,8 +395,6 @@ int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx,
{
if( X86_HAVE( SHA ) )
{
if( IsAsan() )
__asan_verify( input, ilen );
sha1_transform_ni( ctx->state, input, ilen / 64 );
input += ROUNDDOWN( ilen, 64 );
ilen -= ROUNDDOWN( ilen, 64 );
@ -416,8 +403,6 @@ int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx,
X86_HAVE( BMI2 ) &&
X86_HAVE( AVX2 ) )
{
if( IsAsan() )
__asan_verify( input, ilen );
sha1_transform_avx2( ctx->state, input, ilen / 64 );
input += ROUNDDOWN( ilen, 64 );
ilen -= ROUNDDOWN( ilen, 64 );

View file

@ -17,7 +17,6 @@
*/
#include "third_party/mbedtls/sha256.h"
#include "libc/dce.h"
#include "libc/intrin/asan.internal.h"
#include "libc/macros.internal.h"
#include "libc/nexgen32e/nexgen32e.h"
#include "libc/nexgen32e/sha.h"
@ -170,8 +169,6 @@ int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx,
X86_HAVE( SSE2 ) &&
X86_HAVE( SSSE3 ) )
{
if( IsAsan() )
__asan_verify( data, 64 );
sha256_transform_ni( ctx->state, data, 1 );
return( 0 );
}
@ -179,8 +176,6 @@ int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx,
X86_HAVE( AVX ) &&
X86_HAVE( AVX2 ) )
{
if( IsAsan() )
__asan_verify( data, 64 );
sha256_transform_rorx( ctx->state, data, 1 );
return( 0 );
}
@ -306,8 +301,6 @@ int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,
X86_HAVE( SSE2 ) &&
X86_HAVE( SSSE3 ) )
{
if( IsAsan() )
__asan_verify( input, ilen );
sha256_transform_ni( ctx->state, input, ilen / 64 );
input += ROUNDDOWN( ilen, 64 );
ilen -= ROUNDDOWN( ilen, 64 );
@ -316,8 +309,6 @@ int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,
X86_HAVE( BMI2 ) &&
X86_HAVE( AVX2 ) )
{
if( IsAsan() )
__asan_verify( input, ilen );
sha256_transform_rorx( ctx->state, input, ilen / 64 );
input += ROUNDDOWN( ilen, 64 );
ilen -= ROUNDDOWN( ilen, 64 );

View file

@ -16,7 +16,6 @@
limitations under the License.
*/
#include "third_party/mbedtls/sha512.h"
#include "libc/intrin/asan.internal.h"
#include "libc/literal.h"
#include "libc/macros.internal.h"
#include "libc/nexgen32e/nexgen32e.h"
@ -167,8 +166,6 @@ int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx,
if( !IsTiny() && X86_HAVE(AVX2) )
{
if (IsAsan())
__asan_verify(data, 128);
sha512_transform_rorx(ctx, data, 1);
return 0;
}
@ -279,7 +276,6 @@ int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx,
left = 0;
}
if (!IsTiny() && ilen >= 128 && X86_HAVE(AVX2)) {
if (IsAsan()) __asan_verify(input, ilen / 128 * 128);
sha512_transform_rorx(ctx, input, ilen / 128);
input += ROUNDDOWN(ilen, 128);
ilen -= ROUNDDOWN(ilen, 128);