Files
openfang/crates
rager306 b3787e07ea fix: replace unsafe Arc mutation in update_budget with RwLock
PUT /api/budget casts &Arc<AppState> to *mut KernelConfig and mutates
the budget fields through a raw pointer. This is unsound: AppState is
shared across Tokio worker threads, so two concurrent PUT /api/budget
requests cause a data race on the same memory location.

Replace with Arc<tokio::sync::RwLock<BudgetConfig>> stored on AppState,
initialized from kernel.config.budget at startup. All readers use
.read().await and all writers use .write().await. No unsafe code remains
in the budget update path.

Fixes: data race / undefined behaviour under concurrent budget updates
2026-03-22 16:16:09 +07:00
..
2026-03-19 01:34:31 +03:00
2026-03-18 05:49:42 +03:00
2026-03-20 00:33:20 +03:00
2026-03-18 22:55:36 +03:00
2026-03-18 06:23:12 +03:00
2026-03-15 19:50:43 +03:00
2026-03-15 19:50:43 +03:00
2026-03-15 19:50:43 +03:00