From nobody Mon Oct 16 16:59:19 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 4S8Ncl31dPz4xZmS; Mon, 16 Oct 2023 16:59:19 +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 4S8Ncl2YGHz3SNj; Mon, 16 Oct 2023 16:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697475559; 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=6UBguKUVsU2i9xSRL/qoZYLKdPcptxDkXnwqjP56CbE=; b=LBJfPeE6ydU/TG0h09sFJYagkZrSB/khulNGn7t681qK9xdb65on5QIWPYSGnvxDXZ3ze5 XE0I2DIYB0LWXs+mRjziMGXNW6EFFKrg7Dxh+CggMx5j8Ieg/85F2Y7jCSgzeUMtlUIeC9 TZJLGuF0XVk9WoO11K3zLimVtjqt+QAZ/xlp8babJDn1fEpxddt1884Zw7Mo4iTClDlb2f QEPKjgVE4mWGOnQsqFGZLAYCnjeIxXuCaCjOiuMgAbJtm1ElN2FQcNJyipDXih4WahLQS7 q/lVoV5Ez5BWHUnuHG26a/e+dRohdRGekr7pFdmymJwBRRMK9pSB2NdDoNJKNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697475559; a=rsa-sha256; cv=none; b=UlUTIZn9MuGE5oQDEzGbGvFsOPAU/mG0UuVGTk0jOUiPlRLSSzUXbbLTAC/MqDHphm4GAs QSCeS1b7CcJ9gjvL5fmfl/JagEnDnr4oSJKKDj8dnckDysAo1C1HawDhRs38031OntEMc7 qy3XdX7QYcRPDJk59q5CgJ7oU2EIht+p86eInLLfeI6COzhIjrbvLoFXVxYbqEZrGcYk5K VEg4X2ivN/3K89CbPYymV67nx9+1dK1OdU8H1EtzA8b5oogk8YYvULRRgtMKh87epqJJfS BqF22ZYWfXOadm3lzYYq/c4BapC2scg6s7DLxJF5VJLLRiapKAG9hNiuB6hd3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697475559; 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=6UBguKUVsU2i9xSRL/qoZYLKdPcptxDkXnwqjP56CbE=; b=Lp3iWhicnvQbWyRW48UAbly/h6JXWPZC4WOb5LlVbYAA88WzuQPOtz9T7f1qNBpvhSJdYI nmnDNkU8dNlvjs/Q9vW3Ii60CcmBoU+OyU/AqlNgT+yr8FadhKus16aHytRG62kPCRC9Eb TJzimC4PUxgKTKGsJmDgIOH+XQrTIRV+8CLNlYyA3/BPATYiWtVVcviyDNIp6KvhD/aTDs 4daMPDVB/joE0gYsnHaslTehEf+TLiftFiOGXEdQwy0VMx7G3KFNtq5MHEtxZh3m7PblXy RJgbaH/ECY0WE3j+iDadTPjUbhl/jL6RDuiJwnqxce43lVbm4bMCyxoaPcdsSA== 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 4S8Ncl1c4hznSd; Mon, 16 Oct 2023 16:59:19 +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 39GGxJGu028863; Mon, 16 Oct 2023 16:59:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39GGxJTc028860; Mon, 16 Oct 2023 16:59:19 GMT (envelope-from git) Date: Mon, 16 Oct 2023 16:59:19 GMT Message-Id: <202310161659.39GGxJTc028860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 72a4ee26a7c6 - main - libprocstat: make sv_name not static 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72a4ee26a7c665ae1c31abe1c6feeaa7ccaba140 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=72a4ee26a7c665ae1c31abe1c6feeaa7ccaba140 commit 72a4ee26a7c665ae1c31abe1c6feeaa7ccaba140 Author: Brooks Davis AuthorDate: 2023-10-16 16:53:11 +0000 Commit: Brooks Davis CommitDate: 2023-10-16 16:58:37 +0000 libprocstat: make sv_name not static Making this variable static makes is_elf32_sysctl() and callers thread unsafe. Use a less absurd length for sv_name. The longest name in the system is "FreeBSD ELF64 V2" which tips the scales at 16+1 bytes. We'll almost certainly have other problems if we exceed 32 characters. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42199 --- lib/libprocstat/libprocstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index e5481c53eea1..84502bb895b7 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -2392,7 +2392,7 @@ is_elf32_sysctl(pid_t pid) { int error, name[4]; size_t len, i; - static char sv_name[256]; + char sv_name[32]; name[0] = CTL_KERN; name[1] = KERN_PROC;