From 22f54eaee6c6dbe12ad7bb0ee1da09e3e026b970 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Fri, 21 Apr 2023 15:26:06 +0200 Subject: Resource pools are now bound with domains. Memory allocation is a fragile part of BIRD and we need checking that everybody is using the resource pools in an appropriate way. To assure this, all the resource pools are associated with locking domains and every resource manipulation is thoroughly checked whether the appropriate locking domain is locked. With transitive resource manipulation like resource dumping or mass free operations, domains are locked and unlocked on the go, thus we require pool domains to have higher order than their parent to allow for this transitive operations. Adding pool locking revealed some cases of insecure memory manipulation and this commit fixes that as well. --- conf/conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'conf/conf.c') diff --git a/conf/conf.c b/conf/conf.c index 2cfe7b15..c7cd81fe 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -90,7 +90,7 @@ int undo_available; /* Undo was not requested from last reconfiguration */ struct config * config_alloc(const char *name) { - pool *p = rp_new(config_pool, "Config"); + pool *p = rp_new(config_pool, the_bird_domain.the_bird, "Config"); linpool *l = lp_new_default(p); struct config *c = lp_allocz(l, sizeof(struct config)); @@ -515,7 +515,7 @@ config_timeout(timer *t UNUSED) void config_init(void) { - config_pool = rp_new(&root_pool, "Configurations"); + config_pool = rp_new(&root_pool, the_bird_domain.the_bird, "Configurations"); config_event = ev_new(config_pool); config_event->hook = config_done; -- cgit v1.2.3