From nobody Mon Oct 03 23:11:25 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 4MhGmZ2Gwcz4V1LY; Mon, 3 Oct 2022 23:11:26 +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 4MhGmZ1MbYz3QP5; Mon, 3 Oct 2022 23:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664838686; 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=6d+bdzqU8bTVoVynkd9QK/BKR7u7dulP9maAaDRmicc=; b=rZNRcDtyHLcTuluVQHL8d74rnlkskZmgYHE7xZMVrXQeYAyNJaEjfcaJ1vOgCVPjuxaLt2 GkOlnDXqrfUxbVWfrzPq7fkikWYyOon5GP4WGJs1DH8/2PAyNfZRwLFhHiVCJ4OLhzIIBL NS2lr7xiUKyVa0mPZgi6SdjXXVXg2VwfzrLdEEn8edsc3hAVwaF2bchlN3vyhqQCdCiy7v UT5yZzOwNqabhki8fiYnSmhuwlkYDzx++t6wn6sdWSws4MrfVNTIxn+tY5g05UszZ0m30z 6ELwfxcgNPfzKj1Kgn0VnrOhQ0NFKLxvCKTbGUPkYt6hCFysmwamp1Yuvvn8Lg== 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 4MhGmZ0L1KzMdW; Mon, 3 Oct 2022 23:11:26 +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 293NBPq1065697; Mon, 3 Oct 2022 23:11:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 293NBPfH065696; Mon, 3 Oct 2022 23:11:25 GMT (envelope-from git) Date: Mon, 3 Oct 2022 23:11:25 GMT Message-Id: <202210032311.293NBPfH065696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e67b246734e3 - main - libzpool: Disable -Wuse-after-free for dbuf.c. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e67b246734e37d1128fae0faecdd37806c5328ed Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664838686; 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=6d+bdzqU8bTVoVynkd9QK/BKR7u7dulP9maAaDRmicc=; b=yscMy6qpWCZb0KdZ6+caHzIV1t5TWv0dhZaeScjswh3R2Ff8wOLxmWSuIyRZEJZ2fVQIkb NnDDBarT9duMIir7DhdN0srg9Kat3jzhuDw9/mYEndGEBKmCWUYrphGegx41ORp00XssQA 28gkRQ5HwScp+IN6OQhKsDNQBeWtPV0p/KUu0PEQNjudc5xJBLQSnOKhkfLhJsiw8zZBUe 4hLm6b7QscqJr290h16d0V62VHW1IlBy7guiGuzo3JfDcL7a9k2sl4l0GHeKi8Z9M/pPr2 jjWNcFFP8/6kB1K6uFoXZvHr6q327BrB8VmiiwaqtHnwVaAOQE7puv0BxbYc0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664838686; a=rsa-sha256; cv=none; b=jlHFLnRXzPdWmaiBd+w8tvLJvnm6sYVlG+T5zhi+yOW/4qt6G/CEYWc0vSICIZTHdzhQZZ 9lFgndsqMCO3XMiN4E+p6r2juijjZb3nJmvuZ4bzCB0YiGQfCUinEEKq30sZmKeZYGbxc3 bLJRxuZXJUjZeupOr372AzuwvavXyHN+Q3Ofz0xHvca1eNDwCTQjVS+DJTH7OYsh4mTb5A nurPOPcUPHC9SzoNA5aL8GWWBYw2EYayiTIbNzp0HkOsY4MSQsAOOw6Ua+zwe+xjUSuUJ3 EiDgVF2DMRU8MGYP2PTtKIRuKN+Y3zpkqKNdSJ+UMi123ro33v0+T8Ip78M+Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e67b246734e37d1128fae0faecdd37806c5328ed commit e67b246734e37d1128fae0faecdd37806c5328ed Author: John Baldwin AuthorDate: 2022-10-03 23:10:43 +0000 Commit: John Baldwin CommitDate: 2022-10-03 23:10:43 +0000 libzpool: Disable -Wuse-after-free for dbuf.c. The debug traces for reference counting in ZFS use the pointer of the owning object as a "tag" for references to check that when an object drops a reference it had actually held one. In a couple of places ZFS drops references after freeing the owning object. In userland GCC realizes this is a use after free. However, since only the value of the pointer is used, and it isn't indirected, the use is harmless. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D36818 --- cddl/lib/libzpool/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile index b9ef6575c99a..13671752fe88 100644 --- a/cddl/lib/libzpool/Makefile +++ b/cddl/lib/libzpool/Makefile @@ -286,6 +286,10 @@ CSTD= c99 CFLAGS+= -g -DDEBUG=1 +# Pointer values are used as debugging "tags" to mark reference count +# ownerships and in some cases the tag reference is dropped after an +# object is freed. +CFLAGS.dbuf.c= ${NO_WUSE_AFTER_FREE} CFLAGS.entropy_common.c= -fno-tree-vectorize CFLAGS.entropy_common.c+= ${NO_WBITWISE_INSTEAD_OF_LOGICAL} CFLAGS.error_private.c= -fno-tree-vectorize