From nobody Sat Sep 27 15:14:19 2025 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 4cYrb06wr2z68DbP; Sat, 27 Sep 2025 15:14:20 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cYrZz5wnCz44ZK; Sat, 27 Sep 2025 15:14:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758986059; 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=Wg0qa7LYi89pFlkviDT4cUQU1kyJAh1f7Nx/OrSVczI=; b=Hqi6B3q9Dgc7bXugEXYyA8FGHw5kIpjhM7ius40Wog+DBmpB4QGRag9HNU4zUnwQ+zlUf6 z9yuEVNvopKZ01FA8Ab7PXM8RmzRYJe6C3+86jycekdrb16d/ukqdkp3bYiGVxcp78gdXE Ygd+Tf2qXo4fqWyBP5AFBGoWnZpzFYZtBKagmjVHUaNoLIMzjj7lWe/qkzx31RTV09uV5R 1FxWSXgMBDSyw7U93AaebBihdlkJYtuAYhykuTLlkKmGGT7iWmgjruj8aaP3w0mqc4yzRd gjFTuhiKJsFDteZcEO76HWEaMu7OQrDvIkA5xoR42NTVfPtzObuBZIkxmEbr+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758986059; 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=Wg0qa7LYi89pFlkviDT4cUQU1kyJAh1f7Nx/OrSVczI=; b=Xajw8VdRT9An53PkIAM+hSL2ojGq1UFjaHoX9cmtspvdlmLvmv1L+chZDgCh7NVCsdwkZK /hWL73mXjFbaj791Hh6irNRgYUGUNS+lWN/sGhM8Kk1mHWSazpRN4zJVPFEfOJhEXQFcWj rJbw3UNzXNtBzRju40xm17TKwbUsymQZlnajQsy5w5MunhlX4V3M2jNCLAKTG0Emi/Wnhu LImavYgQEZXHtPhyDAWqpCJug+UTMM4Jey7K97Z1jrsrxnuWtnqEOpTQJ6fXQuo+YOS8O0 J93KcOKTD86ffahuOJj5uZeTH8lq0uXqqGRd/CunlIxc0S0Oqm/nm3ew0ZRN9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758986059; a=rsa-sha256; cv=none; b=nocadLiZGyHywOZg59qYTooOF0Z5r+EbuPxio46KMM8odShraU7gL4aSoPV1ZYkVZD60TA 40jNlehlpaJDHOxwJlIHzsrt7lViUnQ2xALx4yIETfQA1m/z8CH6xTOuZQg4eHP2+t2ufe z/CwprmqyJwY3P4FJ4lLccw8fC8uKzCkDVHQLPNXfoSusmL3K3eeiV2s0LN+UC/iXY2ckH cHfEB+86Gg9ShGeXHNtWkuK28RPgWwujVrPqZjdpcCiwPhmBeC5AcgpUN6hIhVZ+aX2sS/ rHNXnfO4Zu6GtnWobCVoFfd8++TCmGyiLPIvBaw1bIJAMhAwzLQMZnIX3SY+ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cYrZz5TCQzfyB; Sat, 27 Sep 2025 15:14:19 +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 58RFEJHB083803; Sat, 27 Sep 2025 15:14:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58RFEJE7083800; Sat, 27 Sep 2025 15:14:19 GMT (envelope-from git) Date: Sat, 27 Sep 2025 15:14:19 GMT Message-Id: <202509271514.58RFEJE7083800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 79d114544fab - stable/14 - tcp: Fix expiring and purging hostcache entries of vnet jails 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 79d114544fabd5a80198e925e4dc34f47a9f9e3a Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=79d114544fabd5a80198e925e4dc34f47a9f9e3a commit 79d114544fabd5a80198e925e4dc34f47a9f9e3a Author: Zhenlei Huang AuthorDate: 2025-09-24 01:16:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-09-27 15:11:41 +0000 tcp: Fix expiring and purging hostcache entries of vnet jails A jailed process, `sysctl -j foo` or `jexec foo sysctl`, do not have privilege to write to non-vnet sysctls but only to those marked as jail writable, aka sysctls those marked with CTLFLAG_VNET flag. Without this change we will get EPERM when trying to expire and purge hostcache entries of vnet jails via the net.inet.tcp.hostcache.purgenow sysctl. Fix that by adding a CTLFLAG_VNET flag. Reviewed by: tuexen, #transport, #network Fixes: 264563806496 Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to expire ... MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D52692 (cherry picked from commit 33ceb31e256e386da5a42cc7ca2ef8d4b81b6eda) (cherry picked from commit fa30199a3dbfe1d4994e7e4e63ad9c582c6f8a1a) --- sys/netinet/tcp_hostcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index ed90a9ba7196..489ea270704e 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -203,7 +203,7 @@ SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, histo, "Print a histogram of hostcache hashbucket utilization"); SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, purgenow, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, sysctl_tcp_hc_purgenow, "I", "Immediately purge all entries");