From nobody Mon Nov 01 14:33:16 2021 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 C4D41182DFFE; Mon, 1 Nov 2021 14:33:24 +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 4Hjb9w0FSVz3sT6; Mon, 1 Nov 2021 14:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 230CF13703; Mon, 1 Nov 2021 14:33:16 +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 1A1EXG2Z021743; Mon, 1 Nov 2021 14:33:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A1EXGxw021742; Mon, 1 Nov 2021 14:33:16 GMT (envelope-from git) Date: Mon, 1 Nov 2021 14:33:16 GMT Message-Id: <202111011433.1A1EXGxw021742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bdfb568f8dfc - stable/13 - redzone: Raise a compile error if KASAN is configured 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bdfb568f8dfc8f1fb22b12cd8281c47bcd388b14 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bdfb568f8dfc8f1fb22b12cd8281c47bcd388b14 commit bdfb568f8dfc8f1fb22b12cd8281c47bcd388b14 Author: Mark Johnston AuthorDate: 2021-07-23 14:30:29 +0000 Commit: Mark Johnston CommitDate: 2021-11-01 14:07:31 +0000 redzone: Raise a compile error if KASAN is configured redzone(9) does some munging of the allocation to insert redzones before and after a valid memory buffer, but KASAN does not know about this and will raise false positives if both are configured. Until this is fixed, do not allow both to be configured. Note that KASAN provides similar checking on its own but currently does not force the creation of redzones for all UMA allocations; this should be addressed as well. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4e8e26a00471f1a5e7a2af322265c45b1529c5b8) --- sys/vm/redzone.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/vm/redzone.c b/sys/vm/redzone.c index affaa5008a22..88e36c41b928 100644 --- a/sys/vm/redzone.c +++ b/sys/vm/redzone.c @@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef KASAN +#error KASAN and DEBUG_REDZONE cannot be configured together +#endif + static SYSCTL_NODE(_vm, OID_AUTO, redzone, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "RedZone data"); static u_long redzone_extra_mem = 0;