mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
hs-v3: Don't crash after SIGHUP in Onionbalance backend mode.
The ob_subcreds array was not copied after SIGHUP, and that left the post-SIGHUP service with a NULL ob_subcreds pointer (until the next descriptor gets build where we regenerate ob_subcreds in hs_ob_refresh_keys()). Fixes bug #33762; not in any released tor version.
This commit is contained in:
parent
9061303080
commit
0667a5af8d
1 changed files with 9 additions and 1 deletions
|
@ -890,10 +890,18 @@ move_hs_state(hs_service_t *src_service, hs_service_t *dst_service)
|
|||
if (dst->replay_cache_rend_cookie != NULL) {
|
||||
replaycache_free(dst->replay_cache_rend_cookie);
|
||||
}
|
||||
|
||||
dst->replay_cache_rend_cookie = src->replay_cache_rend_cookie;
|
||||
src->replay_cache_rend_cookie = NULL; /* steal pointer reference */
|
||||
|
||||
dst->next_rotation_time = src->next_rotation_time;
|
||||
|
||||
src->replay_cache_rend_cookie = NULL; /* steal pointer reference */
|
||||
if (src_service->ob_subcreds) {
|
||||
dst_service->ob_subcreds = src_service->ob_subcreds;
|
||||
dst_service->n_ob_subcreds = src_service->n_ob_subcreds;
|
||||
|
||||
src_service->ob_subcreds = NULL; /* steal pointer reference */
|
||||
}
|
||||
}
|
||||
|
||||
/** Register services that are in the staging list. Once this function returns,
|
||||
|
|
Loading…
Add table
Reference in a new issue