Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 527
    • Issues 527
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 101
    • Merge requests 101
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source Projects
  • BINDBIND
  • Issues
  • #1082

Closed
Open
Created Jun 10, 2019 by Michał Kępień@michalOwner

Detecting conflicts between static and initializing keys is unreliable

The code checking for both static keys and initializing keys being configured for the same domain is unreliable because it calls isc_symtab_define() with the key parameter pointing to a stack-allocated variable. Meanwhile, symtab docs say:

The symbol table library does not make a copy the key field, so the caller must ensure that any key it passes to isc_symtab_define() will not change until it calls isc_symtab_undefine() or isc_symtab_destroy().

This issue manifests itself e.g. by named-checkconf failing to raise a configuration error for at least some configurations which intentionally contain both static and initializing keys for the same domain (e.g. bin/tests/system/checkconf/bad-duplicate-key.conf). If the namebuf local variable in record_static_keys() has a close, but not identical address as the namebuf local variable in check_initializing_keys(), lookups for previously defined symtab entries will fail when they should succeed - but this is just one possible failure mode.

The solution here is to ensure what the docs ask the developer to ensure (e.g. use isc_mem_strdup() for the keys passed to isc_symtab_define() and then clean the copies up properly when isc_mem_destroy() is called).

Assignee
Assign to
Time tracking