myxce/.wolf/bugs/bug-1861.md
Rongsong Shen 25d8a461fa
chore: gitea-sync refreshes 23 recent bug issues to the record format
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 03:44:30 +00:00

1.5 KiB

id status status_updated status_note component severity timestamp last_seen occurrences files tags related fix_commits legacy gitea_issue gitea_synced_status gitea_synced_hash
bug-1861 fixed 2026-09-25 b5d59253 controller unknown 2026-09-24T15:05:56Z 2026-09-24T15:05:56Z 1
src/controller/config_repl.c
controller
security
tmpfile
config-upgrade
b5d59253
true 280 fixed 06b29e927501

bug-1861: config_repl.c do_upgrade_config_with_bytes: temp decode file…

Description

config_repl.c do_upgrade_config_with_bytes: temp decode file /tmp/xce_upgrade_cfg.<pthread_self()>.tmp -- the name is identical across processes (parallel controller_unit_test instances failed handle_upgrade_config with -EINVAL, 'a majority-acked upgrade must succeed') and is opened O_CREAT|O_TRUNC without O_EXCL in world-writable /tmp

Environment

Not recorded (migrated from buglog.json).

Reproduction

Not recorded (migrated from buglog.json).

Root cause

pthread_self() is a thread-descriptor address, not a unique id: the main thread's value repeats across processes (esp. with ASLR off under ASAN), so two processes on one host share and clobber the file; a predictable name opened without O_EXCL in /tmp is also a symlink-attack target (write/truncate through an attacker's link).

Fix

Not recorded (migrated from buglog.json).

Verification

Not recorded (migrated from buglog.json).

References

  • Gitea: #280