Skip to content

mod_macro: Keep the "used on line" label in the config pool - #1085

Merged
arturobernalg merged 1 commit into
apache:trunkfrom
arturobernalg:fix/macro-info-filename-uaf
Nov 25, 2026
Merged

arturobernalg merged 1 commit into
apache:trunkfrom
arturobernalg:fix/macro-info-filename-uaf

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Directives expanded from a keep the "macro 'X' ... used on line N" label as their filename, but use_macro() built it in the temporary config pool, which is destroyed after the configuration is read. mod_info then printed empty or garbled "In file:" labels.

Allocate it from cmd->pool instead (the reporter's patch). The new core test fails without the fix (2 of 300 labels bad locally) and passes with it.

BZ: https://bz.apache.org/bugzilla/show_bug.cgi?id=70378


  • Code follows the httpd style guide.
  • No new log messages.
  • changes-entries/70378.txt included.
  • pyhttpd test in test/modules/core; modules/core passes locally.

use_macro() built the label in cmd->temp_pool, but ap_build_config_sub()
stores only a pointer to it as the filename of each directive expanded
from the macro. The temporary pool is destroyed after the configuration
is read, so mod_info could print freed memory as "In file:".

Submitted by: Leo Bicknell <bicknell@ufp.org>

PR 70378.
@arturobernalg
arturobernalg merged commit 480ad66 into apache:trunk Nov 25, 2026
46 checks passed
arturobernalg added a commit that referenced this pull request Nov 26, 2026
…1088)

mod_macro: Keep the "used on line" label in the config pool (#1085)

use_macro() built the label in cmd->temp_pool, but ap_build_config_sub()
stores only a pointer to it as the filename of each directive expanded
from the macro. The temporary pool is destroyed after the configuration
is read, so mod_info could print freed memory as "In file:".

Submitted by: Leo Bicknell <bicknell@ufp.org>

PR 70378.

(cherry picked from commit 480ad66)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants