From nobody Thu Oct 26 20:39:13 2023 X-Original-To: dev-commits-src-branches@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 4SGd1t1rqYz4yFjX; Thu, 26 Oct 2023 20:39:14 +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 4SGd1s6FkMz3TBw; Thu, 26 Oct 2023 20:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698352753; 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=g3i9QPbFafHPgntWqKAR6UCxNv971L66ENduTHU1OUQ=; b=xht+nczeJnFFdmogciyszdBqyEdM9JmO4Fy7SP1WgqtP9WHxynUG2A/V+A3iVkBphAaoTc 9gli1lnFTOviC0YVMQhW4sTuP/IDvAmiFjbvdx867BGvkm+fxc250bdbEmYT2mNwecdQ5k hv3/B8cnr21lHphxkry8/wVN3Fb8qlBG2nwBdT4BChADgeMc1pt4tY8r7TPoyFUOhUhGNB QmSuhf/TmK498DjdxkVjFCaf3KoMGEkH/CQgRnbY/K0KaWklmszQvM9WAntxbo0gN3Dkit HAqlm9clWuffbpWm/l9BVPe4x7h87hScvvTJ4k3f5RvCAYEaj0mLfwmtt3TUDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698352753; 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=g3i9QPbFafHPgntWqKAR6UCxNv971L66ENduTHU1OUQ=; b=l4PwUINslqQTj+HU3SOa7GkiXBqXnkGB8c0FY1T0aRQhwD/2+LfFihQ8qUMUhZgA5xxAwh AoJOzIqtmcde0MoMbKIRM8cZvl0oe/zE9jWJV0Wne+L2xnAwx8oWYWMLF/6sU8UYOn2U9y r1FXedUdPAWYvsqHpcKvzEeNAQ1tJYAu0V8xztM5BfSwwhvKmS2I/sK1rwp2eHHuOhfMma SwHy/VMqH4ARYfody6mQb/1jvdSTNyLVEDO7HAUptqkWjufME+Dr0g2qmcO/1r8ejY2GSj 0Qt+FKksMQ+/gswirFAFz4gn7YCqImwhGfLbm7JMhQnHMgmhNri7sYkwnOAIRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698352753; a=rsa-sha256; cv=none; b=KKPqjpmpC+1EmcFL71JTNeALjtRP4J4hyI99GwQl7wdCSLK/jOh8ldFcfHDkJ8RPtNIP2n JKEfGAh1wfq/Bsh/dx3VtbuLt/FZ/fGcx15MLjN7ja0j9eauvqfqyzmtZQaFpn14NFkx3H jud42TcwCRNZ9j2F+XSYP2E9KG2IixMALwmiO8Krxh6Eo/k8DENFxPtkBHUgQlM9YDrXWu lGqPvDQ7+anKfgud/rFH+ZzB4px+bzjfG8gUWai4WAHYuuggkeg2Q4j0WuOgcBRxT7l9wo ZDZM6CtdAyEDcSo3xIs7OIyusJ2mUj+3uPhMDXZx5TLXc4oTfqjZAI2tI8PIdg== 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 4SGd1s5McKzm47; Thu, 26 Oct 2023 20:39:13 +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 39QKdDpF091549; Thu, 26 Oct 2023 20:39:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39QKdD3S091546; Thu, 26 Oct 2023 20:39:13 GMT (envelope-from git) Date: Thu, 26 Oct 2023 20:39:13 GMT Message-Id: <202310262039.39QKdD3S091546@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: efeba8da1d2d - stable/13 - libprocstat: make sv_name not static List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: efeba8da1d2da9d2c471936415cfad5f63daae76 Auto-Submitted: auto-generated The branch stable/13 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=efeba8da1d2da9d2c471936415cfad5f63daae76 commit efeba8da1d2da9d2c471936415cfad5f63daae76 Author: Brooks Davis AuthorDate: 2023-10-26 20:38:41 +0000 Commit: Brooks Davis CommitDate: 2023-10-26 20:38:41 +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 0d7a0bcc2649..b23a0a5b2120 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -2395,7 +2395,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;