From nobody Sat Nov 30 19:09:04 2024 X-Original-To: dev-commits-src-all@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 4Y102m2v7Lz5fVrS; Sat, 30 Nov 2024 19:09:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y102m2Ckrz4FNN; Sat, 30 Nov 2024 19:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732993744; 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=aut29pw6ZFbutyd8cut18s8bGcXxMdUYu6CcWTcdXRQ=; b=YRoFS5QPC+sxksrebyt7fR/b8s2hcuRTMnk+nCv+zXTr57s1WMr88ZVcuVXz0VlOBcBql7 oASKDBEf+E5Y9BFZtMbj2xF6Ef68Xsc0pd/y0z46ULOBdRHIIPVUG1aHJOO2ezDQM+hua2 wVEu7TDAjBZ9eVQk+rNOC343VW6wYHnQyf8xR0DhHOB3s9Ct+e6MFgK2ZuBlK4rpU2hoNc /DcDLcNq/MJds6P1sKpC1rQlNQAqiPX8hAAQwO/K9W1xtoTlPVMCIqaQiU0u20cI/ULteu H7Qptc1I2UDvCjyHfR/PcJYYPaaKXnyCbu0f7N5JvO+T9UdwMyd9bgUxBaCkYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732993744; 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=aut29pw6ZFbutyd8cut18s8bGcXxMdUYu6CcWTcdXRQ=; b=MWjBN3+61Q0hJ2KaxiKZ4UrWiOzg9OG8pyIXycgmBdJNe9bqc2Aje9Y6TmZyIZLGBk/ztM GhKAsnJONgRtxzlOUiGLezRNdIH/8Ry+ukOD9r9IeKAIZl/FQYUpAOppFQjpvTUAytCmJm mSiFEEJQV+sSc+bHu8lY63bYKRURScIJpZjG1y9G2lv5wNHXROtFlPy+aMi/2EVzg8oFwJ 65+QSW0PJNSO1iwavUevcYUfVnQGW7SEKlrpUm5KCE2bmrmKzr7gMlu2W+lS4OX6GxjV4y M4ypzLKe8DCoZSUM+qtX7wVo8x3DwV7jXOZ7eLwf1wZfTLELBipHRCjkxV5HeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732993744; a=rsa-sha256; cv=none; b=dlrkmjhxbxnwNWkntwaDsinc1K+bMPVQcq12r0iBgmW4D2HcUFEEZE/TCgNVfRpwURzRcc kUI77RoY+ErPoehCwJ/I5I6by6jB40hVCCrqnq3L+E2CKB9r/6hrCLfU0OI7kbcj/N2VRm kUFoyWDXe56mioP3ZRAvfEGaHR9v7X0sYrR+8StRBLNE53cLVLl6MRPsm4qCqBNu7qZfCp X274xKrRWNgrrjBUdrF5ExhsVdC/sI11pLoynO2oma8ER/QmnWH9IxGHJMjZpJ808txBfN Hi+JzxXTkQ8pcV3D/avSTMwho2K3GAC2SzE3sz47F9DYl7FZgMdNdL8/gSEqTg== 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 4Y102m1hjYzL6C; Sat, 30 Nov 2024 19:09:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AUJ94ZQ097071; Sat, 30 Nov 2024 19:09:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AUJ947S097068; Sat, 30 Nov 2024 19:09:04 GMT (envelope-from git) Date: Sat, 30 Nov 2024 19:09:04 GMT Message-Id: <202411301909.4AUJ947S097068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 155541825168 - stable/13 - libcasper: Neuter false positive -Wuse-after-free warnings from GCC 13 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 15554182516806b79859b867151f4d4fe58ae6e2 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=15554182516806b79859b867151f4d4fe58ae6e2 commit 15554182516806b79859b867151f4d4fe58ae6e2 Author: John Baldwin AuthorDate: 2023-11-15 02:34:01 +0000 Commit: John Baldwin CommitDate: 2024-11-30 17:40:08 +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 (cherry picked from commit b7f7cc25c01aeacaafb86ebcffdeb258b7933b08) --- lib/libcasper/services/cap_grp/Makefile | 3 +++ lib/libcasper/services/cap_pwd/Makefile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/libcasper/services/cap_grp/Makefile b/lib/libcasper/services/cap_grp/Makefile index ee3bdd491895..107be5d7cb46 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_pwd/Makefile b/lib/libcasper/services/cap_pwd/Makefile index 9aaaeb071ca0..bd488bcb42fe 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}