From nobody Wed Nov 15 02:37:40 2023 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 4SVS4j1SYJz50XBg; Wed, 15 Nov 2023 02:37:41 +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 4SVS4j10fcz4XMZ; Wed, 15 Nov 2023 02:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700015861; 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=3yq4M6MEg55EKq8iFY3KUXDNDSHn86neXQYfK5j7w4s=; b=Qdv+srwgRtFEgzDyKrwehwJ8zAM6ckN7jbhSAaJNEole3T6iaV89WKYf/gIo8RHWk70iY8 Yk0hxcw3Yb/cy8UsKT290Mcn/ToLk3mCqGD3VEVkQqiCJtt219Eb03UiycaH+Czq1IjrBb Kp0wCx3p+MNYwtXG7PUhvpTNC3X95u+ZGGTbu7KRwmeoptT1E09yh+CDLmxBQ1PjtwQHdI HrSF8t+upGBmfzAqOrMahJ0cXyPNqo/Hvd2kxMoBJPM9Djr4ReLxzWdP2gAnY6S0ntL8gu Gb20fX6nEUTte6VgB5ep9zucwg89T2cChJVo1pLsmf9zXv4lrXfgUsZ7BrXtNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700015861; 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=3yq4M6MEg55EKq8iFY3KUXDNDSHn86neXQYfK5j7w4s=; b=bednik3csFZqg3TMAYZda2dYAXKDngVy/s1bVntOPwMBHSeWFNZGrYHIYlq/bSyaJpbaHf LEpOoatgImYAXICoHE1cewfLpWtLKCQAfuyBtFMsRSG5IQ4pR6m1ao2cnDGgeLACmvjqdi erVd9ABR7Hygn0KcohRn3N7KC0EZNas2T7HqAGwyOWu3FUxQwe4rMkfnp2YYWYlQYw6rF5 7OTze9T5i+4GrP7JhFRHGtBvKmj01EmPGH93YCqymqrawOF6DL52v6YrL7m31Q4U8bWC1Y dwUnYb8KYj4dZdcGiDbVeCEyt9LcTO961wRapSxdmUq3FC1kBfwXBFdkTXHg0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700015861; a=rsa-sha256; cv=none; b=KRk3/sA6WPwT9Q5IQSJORuEmwekubpk/5R7ZNjIxjm/oopowzwPU7d0Hg7877VuVQSdn4C F1lXoFLUCSqCIRWohWtAhU6xnYVxPQDBEjL115RbAJHmCh29n0aVGeuqXcsiNek3SPjLW+ B4ME9uRORmrdPtOHNUIGSVPbdg9zDmUwxLjFAXd0SoKGPm7vyU4pzOIR/p+BlsmfHboD1D Uk2wHNhaFidMllOb6BZkR7l1rLf+bXMa9Sst7DSmaYWVak+2lxJ+5ytn13BpmCaLr1fW4T 1VoBb5kgO+DPbU5Xzrbly7v6tV2KJLt+Cs3uraK73wtohFKTb38nMS7p7S8uMA== 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 4SVS4h759qz1DWd; Wed, 15 Nov 2023 02:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AF2be3c009579; Wed, 15 Nov 2023 02:37:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AF2beAt009576; Wed, 15 Nov 2023 02:37:40 GMT (envelope-from git) Date: Wed, 15 Nov 2023 02:37:40 GMT Message-Id: <202311150237.3AF2beAt009576@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: b7f7cc25c01a - main - libcasper: Neuter false positive -Wuse-after-free warnings from GCC 13 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: b7f7cc25c01aeacaafb86ebcffdeb258b7933b08 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b7f7cc25c01aeacaafb86ebcffdeb258b7933b08 commit b7f7cc25c01aeacaafb86ebcffdeb258b7933b08 Author: John Baldwin AuthorDate: 2023-11-15 02:34:01 +0000 Commit: John Baldwin CommitDate: 2023-11-15 02:34:01 +0000 libcasper: Neuter false positive -Wuse-after-free warnings from GCC 13 GCC 13 incorrectly thinks a call to free after a failed realloc is a use after free. lib/libcasper/services/cap_grp/cap_grp.c: In function 'group_resize': lib/libcasper/services/cap_grp/cap_grp.c:65:17: error: pointer 'buf' may be used after 'realloc' [-Werror=use-after-free] 65 | free(buf); | ^~~~~~~~~ lib/libcasper/services/cap_grp/cap_grp.c:63:19: note: call to 'realloc' here 63 | gbuffer = realloc(buf, gbufsize); | ^~~~~~~~~~~~~~~~~~~~~~ Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D42576 --- lib/libcasper/services/cap_grp/Makefile | 3 +++ lib/libcasper/services/cap_netdb/Makefile | 3 +++ lib/libcasper/services/cap_pwd/Makefile | 3 +++ 3 files changed, 9 insertions(+) diff --git a/lib/libcasper/services/cap_grp/Makefile b/lib/libcasper/services/cap_grp/Makefile index b46f3bfdaa47..0f722e3979f9 100644 --- a/lib/libcasper/services/cap_grp/Makefile +++ b/lib/libcasper/services/cap_grp/Makefile @@ -40,3 +40,6 @@ MLINKS+=cap_grp.3 cap_grp_limit_fields.3 MLINKS+=cap_grp.3 cap_grp_limit_groups.3 .include + +# GCC 13 complains incorrectly about free after failed realloc: GCC bug #110501 +CFLAGS.cap_grp.c+= ${NO_WUSE_AFTER_FREE} diff --git a/lib/libcasper/services/cap_netdb/Makefile b/lib/libcasper/services/cap_netdb/Makefile index 36c57103b414..653aa21c9b32 100644 --- a/lib/libcasper/services/cap_netdb/Makefile +++ b/lib/libcasper/services/cap_netdb/Makefile @@ -29,3 +29,6 @@ MLINKS+=cap_netdb.3 libcap_netdb.3 MLINKS+=cap_netdb.3 cap_getprotobyname.3 .include + +# GCC 13 complains incorrectly about free after failed realloc: GCC bug #110501 +CFLAGS.cap_netdb.c+= ${NO_WUSE_AFTER_FREE} diff --git a/lib/libcasper/services/cap_pwd/Makefile b/lib/libcasper/services/cap_pwd/Makefile index be6b4b21070f..4e0e6db6f86d 100644 --- a/lib/libcasper/services/cap_pwd/Makefile +++ b/lib/libcasper/services/cap_pwd/Makefile @@ -40,3 +40,6 @@ MLINKS+=cap_pwd.3 cap_pwd_limit_fields.3 MLINKS+=cap_pwd.3 cap_pwd_limit_users.3 .include + +# GCC 13 complains incorrectly about free after failed realloc: GCC bug #110501 +CFLAGS.cap_pwd.c+= ${NO_WUSE_AFTER_FREE}