From nobody Sun Dec 14 19:25:50 2025 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E1BF1D7999; Sat, 19 Apr 2025 10:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745059595; cv=none; b=cU3jozcOfWUYUUs30pGGxcRJDG1JrQpKp0erm85Q1KeHqHh7yH7DM5ojKHlgFCOGOukbQOK+TGrCfB17SfKAA1jBrOTRMfAx3+VLzjRX5tuFCZukk2cUoR1Lf/gbi/7dgwV2i7TFlhi7fJN1h0IZbgGHhAg0aH9ceKbP4QN74dA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745059595; c=relaxed/simple; bh=PDaLLP/sYgP08Fp3qi+j7XEW/p3gaSCx0iAVLrHvJUk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KClBwbeVscr+oHIwDP4FTEuTMdLk2OO3StzzFpQ35ihlfyXP7kfYvAwQoWCBv3oyryjcoUKSvKjCH3/DacDZL9a+6j58WRhMuwEez/rfZFLIcHOxVSMvLh/oUFGK07RvMCD5OGpz5Ug+EEkLgMrHEr0GC85sB9Pqq15jehUzuhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=d+mdfVrh; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="d+mdfVrh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1745059588; bh=PDaLLP/sYgP08Fp3qi+j7XEW/p3gaSCx0iAVLrHvJUk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=d+mdfVrhTzKYz2vjWCrw75JXcNny08XnWlGveh3FzK+WWeXWKOfS8wh/JCwvLa6vi N/mNlNr2dI6/vuZPdA/wasNk+h6CJRSR/cKDz3cHTjTf8BeZyQVTJKe1u0VGm8OHzq MeSC5YumUusdKoJSKkPWof8Eg3g3WeKwn8fagaOY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 19 Apr 2025 12:46:24 +0200 Subject: [PATCH v2 7/7] selftests/nolibc: enable UBSAN if available Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250419-nolibc-ubsan-v2-7-060b8a016917@weissschuh.net> References: <20250419-nolibc-ubsan-v2-0-060b8a016917@weissschuh.net> In-Reply-To: <20250419-nolibc-ubsan-v2-0-060b8a016917@weissschuh.net> To: Willy Tarreau , "Paul E. McKenney" , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745059587; l=1345; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=PDaLLP/sYgP08Fp3qi+j7XEW/p3gaSCx0iAVLrHvJUk=; b=VrOAFef5uSOfNGE+TQ9t/522pEObkrLOAr8L8V7NEGY3EslnUabvmn4udQSryDa21is4soX+2 JEj9D26uYkHCKvVTw7G1+KA+XAPbwy0T0jb/WF0Rs554ZqJtU51pZ6d X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= UBSAN detects undefined behaviour at runtime. To avoid introduction of new UB, enable UBSAN for nolibc-test. By signalling detected errors through traps no runtime dependency is necessary. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selfte= sts/nolibc/Makefile index aa05c1faac20d3054b231090b939d050b0231d40..94f3e8be7a68f63ecd639c4f283= b3cd10764ce74 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -189,9 +189,10 @@ ifeq ($(origin XARCH),command line) CFLAGS_XARCH =3D $(CFLAGS_$(XARCH)) endif CFLAGS_STACKPROTECTOR ?=3D $(call cc-option,-mstack-protector-guard=3Dglob= al $(call cc-option,-fstack-protector-all)) +CFLAGS_SANITIZER ?=3D $(call cc-option,-fsanitize=3Dundefined -fsanitize-t= rap=3Dall) CFLAGS ?=3D -Os -fno-ident -fno-asynchronous-unwind-tables -std=3Dc89 -W = -Wall -Wextra \ $(call cc-option,-fno-stack-protector) $(call cc-option,-Wmissing-protot= ypes) \ - $(CFLAGS_XARCH) $(CFLAGS_STACKPROTECTOR) $(CFLAGS_EXTRA) + $(CFLAGS_XARCH) $(CFLAGS_STACKPROTECTOR) $(CFLAGS_SANITIZER) $(CFLAGS_EX= TRA) LDFLAGS :=3D =20 LIBGCC :=3D -lgcc --=20 2.49.0