From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E99FA22D4DC for ; Thu, 12 Feb 2026 22:00:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770933636; cv=none; b=QeTgv1rU+Ubt9ksj9H23NLCt09oD/sulLACZRECXJsm34rZ0fVn3tCIlOC1/7ICRweQyXsKbRk37NLF2SR2WWfQbgdix5rp+FoHmhs1ZEbG7sNVQO3lycXHf/+eYg7ki5H6ldIlyTgg/I4+7n2TWvKpnTWHhL3QTTMrHhq38djc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770933636; c=relaxed/simple; bh=6vS5vqItIC1vDu0x5wT1q2geIhUhMvtak5ngDTLmqdI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=iHZ3dRElsQl0t3ou1wZZa8bNpkvjho3qWJNXyRWK5mJf7h72UCrHSReecvemluvQt+nmW+i3wX+o6He6yyDvbPurN+QkTDCTdLponViSOrEBU147jLlY77Bi+kVCXUVbT/yuv2Ir9KJ4+5M3fQwcJUho09pbFjf8Ke6DdqkiBp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FiPAiVa5; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FiPAiVa5" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-35621da1a7dso228249a91.0 for ; Thu, 12 Feb 2026 14:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770933634; x=1771538434; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=pRNqJQw+tkJ3hFVQXokGgbRqtvLCppLJT7t4ENUrgog=; b=FiPAiVa5lNa2mta89XqqRWujscN8qtTRq35LkK9qeAZw3mrAYrnHaLO3Nv+k/qKeZU vpR8qcI+efZxmmFKMj3cbyQMWyKa5At7j/NosLi10NPHVXXrXDx+k+EIvAUJ0R5lwiS4 mnPt04LsvkGkeAMsvALOQ49YCKfRagUtqM1i5E5YBq0dtrA/ADUECKIGViqNYiDDJ6Hg zkRk+sslvMjCQzRL+lT5965JbF4s8BYQGJWXif5Rvo0VbmHlWzdrx5eBcj9dr5njg1Bq sgZ2HJTkQLbzqQnT5YHXe5/j/NzKtWsetQTEcJ7L8yHV/tthNco6bNhc5+PVX0ItYT6B EA8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770933634; x=1771538434; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pRNqJQw+tkJ3hFVQXokGgbRqtvLCppLJT7t4ENUrgog=; b=iruKxpNFXzx7M6OJ/GqVSYxIrnAoj3oLL0yNIGqfU87+nizF6wP0pvJsd4ZYy6k3Aj 8Hu1b4g+gLd9844lfolAbVwEuHxCmqK6WnCbYt43urPaso4LWVyFLCzRsCHOoaViti41 FnVCS7DkJMAlDKq4vefj51Vvp1ihQVOw0xaO1RhT3MC2AnKeLNcPk2kkfMXz7ktxGJ6X x/0BS7OdF9/CiqtMCFZGyiAQuE78VQxmQkEVj4qKW3exWElBlRrhzmij9GHNWQoT3IHy ToqwQJyeUwNBORC0QUNJyFZBVv7/X5fMtR4t9WaAQQXoJBUlr2p3ZBg14AQ5wVpRM+UG ybeA== X-Forwarded-Encrypted: i=1; AJvYcCXXnbpZxUnyCn6b3kmIUgoYGNxfWZRDWYzYE2j6dGPIqwoaswx9EiRdywjMSuS6TMq1SAACoW+sqs5f8y8=@vger.kernel.org X-Gm-Message-State: AOJu0YyC2/OskO1TNm3LxNdyYoO4bIhTeDLGv6PzS75RWLeBy9R7CXgj sPPD9yVVqAPLP9OgN3VBlvqS2M1uQwVo+jYyZmaG6IixVdFEsBIRyU1c X-Gm-Gg: AZuq6aJDnMrSkv8J7rF1qT8Cu6MIsvAbYfpRbatd3kWqTaovSn0kX+Pyl3sSMA5DBrs 7O0LpuJas7IcFgfBOAbbzceorsfJADH2uhWQ67BgjZMGlIWTf6SYP2DnlygNN0VURx2oJoLYV08 TW0JPVXbZvo6UIPhdzizMdXSSwUzwnWM7A3CfirJ4DTWHAj0qFcGkFyApHKVSm9o80Kjwc1Umpd tvruLp8DlCWiAnltt8uG6EjY86cm5FpSdSty/2EkORK/HpzXbrsDNTCtO7U/TpDscO7H8Yozux9 ObbE70SHget82apnL47vC26sGUFCoz+wyOWShrBpi/rFUhdhM4Q4TyRII2Bh9nPQm2iE0bV5Su7 UmNzo2pvg2GeV/212t+Pop1XLE28ROiTWlP3qqskBfbjbw/iAKZy3NZWgTM+HxdTNwpONFs1zbz BR+uGFuR54jgLIK2VboeMPQzS42VrX7pXpeYpNmi/7LIhhiiKFPsQ= X-Received: by 2002:a17:90b:2810:b0:34a:a65e:e6ad with SMTP id 98e67ed59e1d1-356a765b9fbmr467430a91.1.1770933634101; Thu, 12 Feb 2026 14:00:34 -0800 (PST) Received: from [192.168.0.56] ([38.34.87.7]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3567eba9b2esm6279778a91.9.2026.02.12.14.00.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 14:00:33 -0800 (PST) Message-ID: <59d226c413864ec7229e4a74af7e663e9982c534.camel@gmail.com> Subject: Re: [PATCH bpf-next v1 00/14] selftests/bpf: Fixes for userspace ASAN From: Eduard Zingerman To: Ihor Solodrai , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann Cc: Amery Hung , Mykyta Yatsenko , Alexis =?ISO-8859-1?Q?Lothor=E9?= , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Date: Thu, 12 Feb 2026 14:00:30 -0800 In-Reply-To: <20260212011356.3266753-1-ihor.solodrai@linux.dev> References: <20260212011356.3266753-1-ihor.solodrai@linux.dev> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.1 (3.58.1-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2026-02-11 at 17:13 -0800, Ihor Solodrai wrote: > This series includes various fixes aiming to enable test_progs run > with userspace address sanitizer on BPF CI. >=20 > The first patch fixes the selftests/bpf/test_progs build with: >=20 > =C2=A0=C2=A0=C2=A0 SAN_CFLAGS=3D"-fsanitize=3Daddress -fno-omit-frame-poi= nter" >=20 > The subsequent patches fix bugs reported by the address sanitizer on > attempt to run the tests. >=20 > The series is a pre-requisite for enabling "test_progs with ASAN" > workflow on BPF CI. I did an experiment: - applied the diff as at the bottom of the email; - compiled with export SAN_CFLAGS=3D"-fsanitize=3Daddress -fno-omit-frame-p= ointer" (using gcc 15.2.1); - double-checked that resulting executable depends on libasan; - did a test run: ./test_progs -a verifier_and. The error report looks as follows: Caught signal #11! Stack trace: /lib64/libasan.so.8(+0x525e7) [0x7f6a506525e7] ./test_progs(crash_handler+0xb5) [0xd152c9] /lib64/libc.so.6(+0x19c30) [0x7f6a50427c30] /lib64/libasan.so.8(+0xdf4a) [0x7f6a5060df4a] /lib64/libasan.so.8(+0xe5bba) [0x7f6a506e5bba] ./test_progs() [0xd19ccc] ./test_progs(main+0xcf6) [0xd1aa79] /lib64/libc.so.6(+0x35f5) [0x7f6a504115f5] /lib64/libc.so.6(__libc_start_main+0x88) [0x7f6a504116a8] ./test_progs(_start+0x25) [0x401935] Am I doing something wrong, or does test_progs signal handler interfere with ASAN reporting? [...] --- diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests= /bpf/Makefile index a0a594de9007..3820077e74e4 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -46,7 +46,7 @@ srctree :=3D $(patsubst %/,%,$(dir $(srctree))) endif =20 CFLAGS +=3D -g $(OPT_FLAGS) -rdynamic -std=3Dgnu11 = \ - -Wall -Werror -fno-omit-frame-pointer \ + -Wall -fno-omit-frame-pointer \ -Wno-unused-but-set-variable \ $(GENFLAGS) $(SAN_CFLAGS) $(LIBELF_CFLAGS) \ -I$(CURDIR) -I$(INCLUDE_DIR) -I$(GENDIR) -I$(LIBDIR) \ diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selft= ests/bpf/test_progs.c index 02a85dda30e6..8839e00167fa 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -1924,7 +1924,7 @@ static void free_test_states(void) free_subtest_state(&test_state->subtest_states[j]); =20 free(test_state->subtest_states); - free(test_state->log_buf); + free(test_state->log_buf + 10); test_state->subtest_states =3D NULL; test_state->log_buf =3D NULL;