From nobody Fri Feb 18 01:51:01 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8E2BD19C0BE3; Fri, 18 Feb 2022 01:51:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K0F5x5jQ4z4ZsG; Fri, 18 Feb 2022 01:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645149062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=goTFYhQXr+mwJfsrZ5hvBilohLOmi1+OgtMWawwKSj8=; b=TZhqRzRAmM5naWJ/XGgPGHjZNIZcUY5ZSMvUj6KqpIaSZ90r2GYLBeXUFAHZvOKFCAYhlt s0d8f/XQT95sm4qI/CH2jl4zs9qdItn3HmZ1osEykMcL4AH6rEwOfso7ArAis83Wz63vp5 pCzQLmM7uisoPb5y+ydQlfDRV/iuZ8tveHxIgcvicxKnh4Yrej10DbctnDmJerBUtoTuLt dLaSN+GpRpGD1yXtahNkvZOLlm5rAIAirFuVSO7pKw48FDwAYRtfwUfKFkLxiSjU36h+Ni bxHjqBTZ4AE7k+ATTvbp1ObHVxFHWU+GSFyb3COQp/ZztxnPUi0yJQyQSb+Xcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 805EF14DB9; Fri, 18 Feb 2022 01:51:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21I1p1DL026028; Fri, 18 Feb 2022 01:51:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21I1p1og026027; Fri, 18 Feb 2022 01:51:01 GMT (envelope-from git) Date: Fri, 18 Feb 2022 01:51:01 GMT Message-Id: <202202180151.21I1p1og026027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ae6cb173d452 - stable/13 - compiler-rt: re-exec with ASLR disabled when necessary List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae6cb173d45229a00e998827fa4a83777e14bdc4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645149062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=goTFYhQXr+mwJfsrZ5hvBilohLOmi1+OgtMWawwKSj8=; b=NmuNW+PzvkPHypxodsnW9MMlSn1fT+OGEUpqncpMnRrJHsudVtXyaS5NXubeTQfdar9Ea4 RJYYzP/DZ1y7oQotNfqCGQRJFU/YK0LZcsejJIovkP9mYjfHuq88JqICMfDV/161OqflL3 14slVcynK3yEr0JpuUQ3ednplueNHkvvDSXq4IJ5enxo0bohVpidW6MsorSkJSKLnIaYjM IgIo8Dw9Fa+YCyBAgp0R3Sa8Jmm5zVTSQK64tgxzIoLqPxaHu+bXEq0HBQ3SgPTeSka4Hh 1GNgUxw0waIqKO420mr9aU+Qe98yOFDnpTK0rHdOCPuqWPu7OioDFu/ZEF/Nqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645149062; a=rsa-sha256; cv=none; b=CEdsaUtA1fWY0ZwD7t3dErB1CTmy5Zj3a9i/pr4iE6wIKZYYdCfDKrbeHushTmqcFiJsYj XzDwkaH2ZhpvMVlHni2dxCafm4BVYKEORArOSwxx7QoDkTf5WKnwio/cSOj7we9xf8Yj2k sPoD26wDmQlRi/IsBwbeH3fbv2+0D00t/pP66uDi0SDvCDu3PRtlNNQrdoCxadi57zVvrU WwkPvL1YiePzSSUa8XFUgQnX2Vv7eWpN3bG8xlZFKrVR/ITR1qqv/N8sjqown+TD/GOjy5 qnJFW01bPQID32OdYN92woXYfiFYK8ZCnb/Hxjj0FHE/7NmfUqT9If019Lgmlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ae6cb173d45229a00e998827fa4a83777e14bdc4 commit ae6cb173d45229a00e998827fa4a83777e14bdc4 Author: Ed Maste AuthorDate: 2022-01-16 19:22:05 +0000 Commit: Ed Maste CommitDate: 2022-02-18 00:32:50 +0000 compiler-rt: re-exec with ASLR disabled when necessary Some sanitizers (at least msan) currently require ASLR to be disabled. When we detect that ASLR is enabled, re-exec with it disabled rather than exiting with an error. See LLVM GitHub issue 53256 for more detail: https://github.com/llvm/llvm-project/issues/53256 No objection: dim MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33934 (cherry picked from commit 930a7c2ac67e1e8e511aa1d0a31a16c632060ebb) --- .../compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp index 09b3f31831df..daa07c15490e 100644 --- a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp +++ b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp @@ -2197,8 +2197,11 @@ void CheckASLR() { } if ((aslr_status & PROC_ASLR_ACTIVE) != 0) { Printf("This sanitizer is not compatible with enabled ASLR " - "and binaries compiled with PIE\n"); - Die(); + "and binaries compiled with PIE\n" + "ASLR will be disabled and the program re-executed.\n"); + int aslr_ctl = PROC_ASLR_FORCE_DISABLE; + CHECK_NE(procctl(P_PID, 0, PROC_ASLR_CTL, &aslr_ctl), -1); + ReExec(); } #else // Do nothing