Dovecot 2.4.5 master SIGSEGV on reload — stale configuration pointer confirmed
Hello Dovecot maintainers,
Following up on my report about the Dovecot master crashing during reload. We reproduced the crash twice on a Debian 13 amd64 test host running the vendor package 2:2.4.5-2+debian13. The new capture used GDB 16.3 with matching Dovecot and glibc debug symbols.
The master was started with the command-line override
-o */verbose_proctitle=no. An initial reload completed successfully
and the same master served the expected TLS certificate over IPv4 and
IPv6. A subsequent native systemd reload of the unchanged configuration
caused that master to exit with SIGSEGV.
GDB showed that the original configuration mapping reached a reference
count of zero at the call to munmap. At the crash, set->block_names[0]
for the */verbose_proctitle override still pointed into that original
mapping. The pointer matched both the first argument to strcmp and the
fault address reported by the kernel. The region was absent from the
process's current mappings, and the new configuration used a different
mapping.
Backtrace excerpt
__strcmp_avx2 strcmp-avx2.S:283
setting_override_match_info settings.c:1911
settings_override_filter_match settings.c:1931
settings_apply_add_override settings.c:2209
settings_instance_override_init settings.c:2270
...
master_service_settings_read_int master-service-settings.c:642
master_service_settings_read master-service-settings.c:682
sig_settings_reload master/main.c:421
The packaged settings.c matches upstream revision
0cbb641e3e88d1616c2e8c1ff109c67c0985ddc6. In
settings_override_set_blocks, the array is allocated in the override's
pool, while its entries point into the configuration mapping. The reload
path reused one of those entries after the mapping had been released.
One correction to my earlier report. The status 75 after the first crash
came from a subsequent control process whose action remains unidentified.
In the renewal rehearsal, ExecReload had returned 0 and the later
“Dovecot is not running” message came from doveadm stop.
Is there already a fix for this lifetime issue in lib-settings? We can verify a proposed fix against the same TEST configuration.
Thank you.
Hello Dovecot maintainers,
Following up on my report about the Dovecot master crashing during
reload. We reproduced the crash twice on a Debian 13 amd64 test host running the vendor package 2:2.4.5-2+debian13. The new capture used GDB 16.3 with matching Dovecot and glibc debug symbols.
The master was started with the command-line override
`-o */verbose_proctitle=no`. An initial reload completed successfully
and the same master served the expected TLS certificate over IPv4 and
IPv6. A subsequent native systemd reload of the unchanged configuration
caused that master to exit with SIGSEGV.
GDB showed that the original configuration mapping reached a reference
count of zero at the call to `munmap`. At the crash,
set->block_names[0]
for the */verbose_proctitle override still pointed into that original
mapping. The pointer matched both the first argument to strcmp and the
fault address reported by the kernel. The region was absent from the
process's current mappings, and the new configuration used a different
mapping.
Backtrace excerpt
__strcmp_avx2 strcmp-avx2.S:283
setting_override_match_info settings.c:1911
settings_override_filter_match settings.c:1931
settings_apply_add_override settings.c:2209
settings_instance_override_init settings.c:2270
...
master_service_settings_read_int master-service-settings.c:642
master_service_settings_read master-service-settings.c:682
sig_settings_reload master/main.c:421
The packaged settings.c matches upstream revision
0cbb641e3e88d1616c2e8c1ff109c67c0985ddc6. In
`settings_override_set_blocks`, the array is allocated in the override's
pool, while its entries point into the configuration mapping. The reload
path reused one of those entries after the mapping had been released.
One correction to my earlier report. The status 75 after the first crash
came from a subsequent control process whose action remains
unidentified.
In the renewal rehearsal, ExecReload had returned 0 and the later
"Dovecot is not running" message came from doveadm stop.
Is there already a fix for this lifetime issue in lib-settings? We can
verify a proposed fix against the same TEST configuration.
Thank you.
participants (1)
-
Andrés Alvarez