Page MenuHomeFreeBSD

tcp: Fix expiring and purging hostcache entries of vnet jails
ClosedPublic

Authored by zlei on Sep 23 2025, 3:29 PM.
Tags
None
Referenced Files
F167970778: D52692.id162657.diff
Tue, Aug 25, 4:49 PM
F167928945: D52692.id162657.diff
Tue, Aug 25, 11:45 AM
F167877080: D52692.diff
Tue, Aug 25, 4:51 AM
Unknown Object (File)
Mon, Aug 17, 10:44 PM
Unknown Object (File)
Sat, Aug 15, 8:00 AM
Unknown Object (File)
Sun, Aug 9, 4:08 AM
Unknown Object (File)
Sat, Aug 8, 12:45 PM
Unknown Object (File)
Sat, Aug 8, 9:47 AM

Details

Summary

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.

Fixes: 264563806496 Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to expire ...
MFC after: 3 days

Test Plan

Expire entries in hostcache of a jail immediately.

# jail -c name=foo vnet persist
#sysctl -j foo net.inet.tcp.hostcache.purgenow=1
net.inet.tcp.hostcache.purgenow: 0 -> 0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable