Commit af1937c3 authored by Michał Kępień's avatar Michał Kępień
Browse files

[master] Prevent crashing due to a race during server shutdown

4884.	[bug]		named could crash on shutdown due to a race between
			shutdown_server() and ns__client_request(). [RT #47120]
parent 4fcc5508
4884. [bug] named could crash on shutdown due to a race between
shutdown_server() and ns__client_request(). [RT #47120]
4883. [cleanup] Improved debugging output from dnssec-cds. [RT #47026]
 
4882. [bug] Address potential memory leak in
......
......@@ -9347,11 +9347,9 @@ shutdown_server(isc_task_t *task, isc_event_t *event) {
*/
static isc_result_t
get_matching_view(isc_netaddr_t *srcaddr, isc_netaddr_t *destaddr,
dns_message_t *message, dns_ecs_t *ecs,
dns_message_t *message, dns_aclenv_t *env, dns_ecs_t *ecs,
isc_result_t *sigresult, dns_view_t **viewp)
{
dns_aclenv_t *env =
ns_interfacemgr_getaclenv(named_g_server->interfacemgr);
dns_view_t *view;
REQUIRE(message != NULL);
......
......@@ -2262,6 +2262,7 @@ ns__client_request(isc_task_t *task, isc_event_t *event) {
unsigned int flags;
isc_boolean_t notimp;
size_t reqsize;
dns_aclenv_t *env;
dns_ecs_t *ecs = NULL;
#ifdef HAVE_DNSTAP
dns_dtmsgtype_t dtmsgtype;
......@@ -2372,9 +2373,8 @@ ns__client_request(isc_task_t *task, isc_event_t *event) {
* Check the blackhole ACL for UDP only, since TCP is done in
* client_newconn.
*/
env = ns_interfacemgr_getaclenv(client->interface->mgr);
if (!TCP_CLIENT(client)) {
dns_aclenv_t *env =
ns_interfacemgr_getaclenv(client->interface->mgr);
if (client->sctx->blackholeacl != NULL &&
dns_acl_match(&netaddr, NULL, client->sctx->blackholeacl,
env, &match, NULL) == ISC_R_SUCCESS &&
......@@ -2632,7 +2632,7 @@ ns__client_request(isc_task_t *task, isc_event_t *event) {
ecs = &client->ecs;
}
result = client->sctx->matchingview(&netaddr, &client->destaddr,
client->message, ecs,
client->message, env, ecs,
&sigresult, &client->view);
if (result != ISC_R_SUCCESS) {
char classname[DNS_RDATACLASS_FORMATSIZE];
......
......@@ -56,7 +56,7 @@ typedef void
*/
typedef isc_result_t
(*ns_matchview_t)(isc_netaddr_t *srcaddr, isc_netaddr_t *destaddr,
dns_message_t *message, dns_ecs_t *ecs,
dns_message_t *message, dns_aclenv_t *env, dns_ecs_t *ecs,
isc_result_t *sigresultp, dns_view_t **viewp);
/*%
......
......@@ -86,12 +86,13 @@ static isc_logcategory_t categories[] = {
static isc_result_t
matchview(isc_netaddr_t *srcaddr, isc_netaddr_t *destaddr,
dns_message_t *message, dns_ecs_t *ecs,
dns_message_t *message, dns_aclenv_t *env, dns_ecs_t *ecs,
isc_result_t *sigresultp, dns_view_t **viewp)
{
UNUSED(srcaddr);
UNUSED(destaddr);
UNUSED(message);
UNUSED(env);
UNUSED(ecs);
UNUSED(sigresultp);
UNUSED(viewp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment