summaryrefslogtreecommitdiff
path: root/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2026-01-16 16:39:01 -0800
committerGleb Smirnoff <glebius@FreeBSD.org>2026-01-16 16:39:01 -0800
commite3caa360d5d0a73af0de1d293d5b8ff6e900ceb4 (patch)
tree0c418a4a09f06314311a6dab3c6f7cdca761bd8a /source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
parent7eac31c83ee3fca6a2c19ee0aa21a310e0050f51 (diff)
ipfw: make the upper half lock sleepable
The so called upper half ipfw lock is not used in the forwarding path. It is used only during configuration changes and servicing system events like interface arrival/departure or vnet creation. The original code drops the lock before malloc(M_WAITOK) and then goes into great efforts to recover from possible races. But the races still exist, e.g. create_table() would first check for table existence, but then drop the lock. The change also fixes unlock leak in check_table_space() in a branch that apparently was never entered. Changing to a sleepable lock we can reduce a lot of existing complexity associated with race recovery, and as use the lock to cover other configuration time allocations, like recently added per-rule bpf(4) taps. This change doesn't remove much of a race recovery code, to ease bisection in case of a regression. This will be done in a separate commit. This change just removes lock drops during configuration events. The only reduction is removal of get_map(), which is a straightforward reduce to a simple malloc(9). The only sleepable context where the lock was acquired was dyn_tick(). The comment said it is done to prevent parallel execution of dyn_expire_states(). However, there is proper internal locking in there and function should be safe to execute in parallel. The real problem is dyn_expire_states() called via userland to race with dyn_grow_hashtable() called via dyn_tick(). Protect against this condition with the main chain lock. Differential Revision: https://reviews.freebsd.org/D54535
Diffstat (limited to 'source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp')
0 files changed, 0 insertions, 0 deletions