From nobody Thu Oct 26 17:37:35 2023 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 4SGY0H3r3Hz4y5Fn; Thu, 26 Oct 2023 17:37:35 +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 4SGY0H2vbPz4ZQg; Thu, 26 Oct 2023 17:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698341855; 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=Og/RGHdOFHlDXLNSSgqowtj0B73c6+rNIIpNWytt+dI=; b=wYORRVn5imR3MiD7B0E8dgd6jlmtvfieb/sG6vfHjAZrTk0CN6HC5NvBe10WB4i9u+eJL5 UMjGOLZBhX1DxaCJaYZC3t7J77C/UqjCv86o9PA6BsU8QJtampRQdw9R/tVG63qtbbglhO oF/FdfoeH2pRhzW7132R7ThlOedSghzFly8iS1fsJy2KU4zWoIKwFNZoC3/9D8kGFmp0+f SmUQt3NtOdRElrqOadDZfO4UNd/SsoX+F4tIomozoMxijdPchwGwiYZ3UExRzsM9DwlrDB gvF+lwalAxL0gQM6vQYSwDBO/bTI5SwNfPoqEMERY57XoZjXpVtAILeGs4Su2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698341855; 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=Og/RGHdOFHlDXLNSSgqowtj0B73c6+rNIIpNWytt+dI=; b=oS/Bs8Cuod3PhxBQQzgN8MXfrYWt8TCpf3vTLHt28Y6J+JGELrKLu5lomSz7SdHw/OfLfC DkmkEOOYGeHYPTqPc00KdH6IO7mA4m6BjdBZdjXgCuO9pzcavJkgnkBKw4KaLXF6Zxzr4r Idakhik4DBCZZZgPmPZJyj0aZZqNuYuo1Plic5c/kAXPCApsOGvOq4SQscaU92SzNB1L8I ur1tX2HwxRMKzdQ6yOG1XJ3//Uqhb4stjEUwmLf5YBhEY6WKkGsUVzxTxjVRho2f3xEnrm sfVIXfOjZcVEpafcgx5Nftu4mHHoeUrQnJYYIIkruh4uYujHVM7x2KdRvv1rCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698341855; a=rsa-sha256; cv=none; b=DXsE0nsvgoH1c10B60eeAuLVNuybPJakJbRQHlDQ5NaT0Z412NSbiuSbi1YGlSRtv1SK90 A3XTPBzYtX7eu5nZ7liBu3AP93iGwoHWBfYthtthzzcYnans+TcGLUDCwO8a/0MoQBo9rg TigboVYxF6WNqG6M3FRoPjJ48TgGoYI58gRPjgL+yPKOvHTg6YWO7d8CMLA7VN+JkxKO9O Xjug0qKTYC8MGf84aezeYj5uG9R4cGubSzJEAVaezs6p9slSNkXEguD67urbpr6sjsJp1v YdrprQWh587rXiklx4rqLSx2DRsc+hyfJ3JT/86qf7Zf9fpVJsYGm8H+z4C5oQ== 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 4SGY0H1xfGzgq4; Thu, 26 Oct 2023 17:37:35 +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 39QHbZBQ089758; Thu, 26 Oct 2023 17:37:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39QHbZml089755; Thu, 26 Oct 2023 17:37:35 GMT (envelope-from git) Date: Thu, 26 Oct 2023 17:37:35 GMT Message-Id: <202310261737.39QHbZml089755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 9b48cb8e89c8 - stable/14 - libprocstat: make sv_name not static 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9b48cb8e89c86128c1d9d89eea67ef4b28a38c52 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9b48cb8e89c86128c1d9d89eea67ef4b28a38c52 commit 9b48cb8e89c86128c1d9d89eea67ef4b28a38c52 Author: Brooks Davis AuthorDate: 2023-10-16 16:53:11 +0000 Commit: Brooks Davis CommitDate: 2023-10-25 23:30:51 +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 (cherry picked from commit 72a4ee26a7c665ae1c31abe1c6feeaa7ccaba140) --- 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;