From nobody Sat Oct 4 16:44:41 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 4cfBG20ZP9z69Jbs; Sat, 04 Oct 2025 16:44:42 +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 4cfBG12wSLz3L8Y; Sat, 04 Oct 2025 16:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596281; 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=K7TcMQaJtwj+9TJALIxgptdJWo5OP8c9NhRGKxIVPx8=; b=lMAXihPCW6fpYAJXhbwt18etBVwQQLkjO+mXsIFa4MildQGrcHkOnqsmuVnYFtI/LcWjF2 hNGUB92gYhOYS0zeZZi3itzRsdP9PZehe5ufYXfjxSRp3/MA/K0Lvh5O0tDdKfwmCTWsjY PpcVTLUDz4G73vJx/ShuReS0NEkqN2SI+0ZfGwEV/r9UY3shRS6tpFlSDMP4MrWMrlHbAj WqIcDdmw1t/yzu6YH5GnUH0jof4bCcgalqduWBDDCzKoHfvXdjJWhPRU4VHSFYCTfiK+8j X8zrtPBzCXD9dn3l482Cxagg379jE0SYpwKsVY1URmcC+3W8YBTB1yZRSoKEEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596281; 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=K7TcMQaJtwj+9TJALIxgptdJWo5OP8c9NhRGKxIVPx8=; b=eaGWVV6lKDwdqOH7dF0zGC0HnX5WgRGqnhUohOyCmhDIA84ZTL42Kc3X+zu+Xz8cYAQqKl c/rqView9IlURrHu1WguYQ3l/T6AbGOsRUrEtn0Gj331cjRg7zXHEse7LnJLsi53dsHYSa FmltvnksweMJATzvJ+LLpwuxdnJpRGrWohUIwTwIx+rePvYXkfJaa5BZ0/vnAWZVuREOSz D+q2331UX2LXrEaa36r6Hmyfh6+EP9QKDZyK+LaLZfCudepA7ipS02yXoc+twk8GcyRbM4 P1aeM8EQUlow+1Z5tHoiZQV+tPGZT91xSrSsT70AZtFVJ91ZHIev74sEuWuEMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596281; a=rsa-sha256; cv=none; b=cTkT0fxg5yNg88SXLc9UZ7wHDW5h+QJyTjZqYNCNWi8Oy4Ng1oyYaOkWmI++LJbL7rHQGs 0aNBY5tAzqFX5LkO0yQkeG1I4JhbRNQ9vRTVc2wSNywQNIEeouN4r4EMgTNTc9QjbRoyOO uiwZPh+09XQ8ifMDI3nRQazSiRsXyBwcs8eQCqlQGk6LN23v9+NT6RizvKt1eJ8bzTMmqg XtVPfgCfImAAQjwpYh6NHFPujAU05uWoaE8B7gm73iKCwfFTmvdtMjOXwYKsVZx5TexnDx OSPzu/lL6Uh1E48bRBqYWcW5syDzsY8vQ4B0EOCAs3hcfc/QHjnZ5+df9lv4Dg== 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 4cfBG12Sm8zqR5; Sat, 04 Oct 2025 16:44:41 +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 594GifFM058333; Sat, 4 Oct 2025 16:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GifXK058330; Sat, 4 Oct 2025 16:44:41 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:41 GMT Message-Id: <202510041644.594GifXK058330@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: 4b92e54c9b5a - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 4b92e54c9b5a531c12ac50add5da6eaf39b19380 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=4b92e54c9b5a531c12ac50add5da6eaf39b19380 commit 4b92e54c9b5a531c12ac50add5da6eaf39b19380 Author: Zhenlei Huang AuthorDate: 2025-09-24 01:16:13 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:25 +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) (cherry picked from commit 79d114544fabd5a80198e925e4dc34f47a9f9e3a) --- 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 d40b27a251f5..6e987fd4b521 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -174,7 +174,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");