From nobody Fri Feb 04 16:20:49 2022 X-Original-To: dev-commits-src-main@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 ED4FE19A8A89; Fri, 4 Feb 2022 16:20:49 +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 4Jr14161qFz3kg4; Fri, 4 Feb 2022 16:20:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643991649; 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=A9wHw6F9Wl72Mq0zLYNiVPx/3WSjCSgG7MhlOs1FfEM=; b=yB0En0a86Ut3skxeYBelv9X2v1nc94qoPxnWd3ejvWVANwnXcDtNga67LtkgJ5BP4GvZ/Y KyyQLeWVmSvx6J7AqA80qS2Wyd3m3nA+vEiaMuO3bh6pEYbcR7oh/yXwppMRGDnUKHKvFf o+xhzrf+pQ+/PjO2iySxqZsqsba2k/6HTNbF0+uf1GpEojYRkwYtvGkFCUclUCJs0Gqc8L 6K/5RklYtYb8em0NdibE9EHhZbcNSw6vpCfiflcC+QbbTqJ/13DEbKXn87eQI4pLAOiU/A cgmAhdsCfAI8apiEH9n3ZkmH3bHnTPyN668PbXDDEAUUvLWZFweYfZgprV76hw== 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 AFB8D6E03; Fri, 4 Feb 2022 16:20:49 +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 214GKnHX007539; Fri, 4 Feb 2022 16:20:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 214GKn2V007538; Fri, 4 Feb 2022 16:20:49 GMT (envelope-from git) Date: Fri, 4 Feb 2022 16:20:49 GMT Message-Id: <202202041620.214GKn2V007538@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 930a7c2ac67e - main - compiler-rt: re-exec with ASLR disabled when necessary List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 930a7c2ac67e1e8e511aa1d0a31a16c632060ebb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643991649; 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=A9wHw6F9Wl72Mq0zLYNiVPx/3WSjCSgG7MhlOs1FfEM=; b=SiHOz3sMGArLFjr4IXv9O6N9O2y3cNUwjonOqZ+r2X8dnizi1t0rGRqOnW9sgEj+JXInb9 x1ZbB3a/wxmPoaMSkLt/FA83XmdtCZFkvjPFo8yUVKAKfvUWEG5UbB8VHgAYni+LT8CQcO n+BZfSb45U0rRrlAB96OIXcBuTcdReJ3cYqvosvpdZTmS2r+NBbPdlh1Lc3hoHmekMMxkh 2kue4IDhpLClqsjpZAf9taL1opJKuofm/dNH67UCBcQG6wL0roxEUjCjcaEPY8NRIbAtwI W3IJdfxJhRiJ7/zcN7jC2ph44rI+ZwInXp/lAu31Y0/SIZDPQ9KvxV3Nkf3hfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643991649; a=rsa-sha256; cv=none; b=ZcUOzbspUsn9zWfcuDGuRzx9lMHZEvjGNl61U0VUb+mUlr7rgOb6yfg5QGjaIi+kcMyrtk TJ3yRN4wBNKqidgb8UsGIj2JgmNhwoBnIb96xiUcrUYkkXBLyPlctDEGKO6nfuwN4lYMBE m8dSZ67LEc4HE5Ir/zputtSYb7e3AghE0tnbxGEzao95O9B3ni4vb4cQc8L0v+wVCPxkE+ cmMIM4Pa2k1aI7YbYBvZ+FvmChFwwZ6WZbw6OX1663RLI6PBIFKPkUbh0LTXDY6A10tgvF r3qHZXUJE36JWRiYo1HvwHpmARvqeRif1VBC6yUu6giypwr2QHjJMuL93WFx5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=930a7c2ac67e1e8e511aa1d0a31a16c632060ebb commit 930a7c2ac67e1e8e511aa1d0a31a16c632060ebb Author: Ed Maste AuthorDate: 2022-01-16 19:22:05 +0000 Commit: Ed Maste CommitDate: 2022-02-04 16:20:00 +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 --- .../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