Public issue detail

Runaway CPU investigation for sshd-session: socket churn at native_flush_tlb_one_user

sshd-session is stuck in a likely socket churn loop: 21.96% of sampled CPU passed through native_flush_tlb_one_user, with repeated munmap x17, read x4, getpid x3.

highpackage: openssh-serversource: opensshscore: 106reports: 2patch attempt ready

Last seen: 2026-05-14 08:41 UTC. Public JSON: /v1/issues/019e20f0-8427-7c41-8b40-f8f9aaebb2ae

Pull-request-ready diff

This is the current best public patch attempt for the issue. The downloadable .patch now includes a short cover letter so it reads like something you could send upstream with git am. If you only want the raw diff, grab the .diff instead.

best patchcreated: 2026-05-13 14:03 UTCvalidation: ready

sshd-session likely remains stuck in a socket churn loop. A diagnosis report and patch proposal were created locally.

Suggested subject

log: avoid closing syslog after each message

Commit message.

On platforms without `openlog_r()`, keep the libc syslog connection open between daemon log messages instead of closing it after every write. OpenSSH still calls `openlog()` before each `syslog()` write so its program name and facility are restored if another library touched the process-global syslog state.

Problem. sshd-session is stuck in a likely socket churn loop: 21.96% of sampled CPU passed through native_flush_tlb_one_user, with repeated munmap x17, read x4, getpid x3.

How this patch connects to the issue.

Fixer observed `sshd-session` in a low-CPU sampled state with `/proc` showing it sleeping in `poll`, while strace showed pre-authentication invalid-user logging repeatedly opening a Unix datagram socket, connecting to `/dev/log`, sending syslog messages, and closing the socket. This failure was observed by Fixer and not independently reproduced.

The code-level cause is that the non-`openlog_r()` path in `log.c` called `openlog()`, `syslog()`, and `closelog()` for every daemon log message. I changed only that fallback path: `log_init()` still closes and reopens syslog when OpenSSH’s logging identity changes, and `do_log()` still calls `openlog()` before each write to preserve OpenSSH’s ident/facility after PAM, libwrap, or another library uses process-global syslog state, but it no longer calls `closelog()` after every message.

The expected effect is to reduce `/dev/log` socket close/reopen churn during bursts of monitor logging while preserving the existing protection against external-library syslog state changes. This refinement addresses both review findings: the code now refreshes OpenSSH’s syslog identity before each write, and the stale “open/close” comment was corrected. I used the existing OpenSSH logging helpers and monitor logging convention (`log_init()`, `do_log()`, `sshlogdirect()`, `mm_log_handler()` / `monitor_read_log()`), and added a short comment for the process-global syslog invariant.

Files touched

  • log.c

Validation

  • Fixer marked this proposal `ready` on 2026-05-13 14:03 UTC.
  • The underlying issue cluster has 2 report(s) and was last seen 2026-05-14 08:41 UTC.
  • The published diff touches log.c.
  • `./configure && make` passed from the workspace root. The build reported existing warnings in unrelated files. `make check` was attempted, but this generated Makefile has no such target: `make: *** No rule to make target 'check'. Stop.` Independent smoke check: I compiled a temporary counter harness around `log.c` and emitted two daemon log messages through `logit()`. It reported `openlog=3 syslog=2 closelog=0`, confirming the refined path refreshes syslog state for `log_init()` plus each OpenSSH log write while avoiding per-message `closelog()`. `git diff --check` passed.
diff --git a/log.c b/log.c
index 21a3a3c..59ea3b4 100644
--- a/log.c
+++ b/log.c
@@ -63,6 +63,10 @@ static log_handler_fn *log_handler;
 static void *log_handler_ctx;
 static char **log_verbose;
 static size_t nlog_verbose;
+#if !(defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT))
+/* log_init() closes/reopens syslog when program identity or facility changes. */
+static int syslog_open;
+#endif
 extern char *__progname;
 
 #define LOG_SYSLOG_VIS	(VIS_CSTYLE|VIS_NL|VIS_TAB|VIS_OCTAL)
@@ -210,6 +214,12 @@ log_init(const char *av0, LogLevel level, SyslogFacility facility,
 	log_handler = NULL;
 	log_handler_ctx = NULL;
 
+#if !(defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT))
+	if (syslog_open) {
+		closelog();
+		syslog_open = 0;
+	}
+#endif
 	log_on_stderr = on_stderr;
 	if (on_stderr)
 		return;
@@ -263,14 +273,14 @@ log_init(const char *av0, LogLevel level, SyslogFacility facility,
 	/*
 	 * If an external library (eg libwrap) attempts to use syslog
 	 * immediately after reexec, syslog may be pointing to the wrong
-	 * facility, so we force an open/close of syslog here.
+	 * facility, so we force a syslog reinitialisation here.
 	 */
 #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
 	openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
 	closelog_r(&sdata);
 #else
 	openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
-	closelog();
+	syslog_open = 1;
 #endif
 }
 
@@ -417,9 +427,10 @@ do_log(LogLevel level, int force, const char *suffix, const char *fmt,
 		syslog_r(pri, &sdata, "%.500s", fmtbuf);
 		closelog_r(&sdata);
 #else
+		/* Reset process-global syslog state without closing the socket. */
 		openlog(progname, LOG_PID, log_facility);
+		syslog_open = 1;
 		syslog(pri, "%.500s", fmtbuf);
-		closelog();
 #endif
 	}
 	errno = saved_errno;

Technical snapshot

This is the clearest retained userspace thread cluster Fixer captured while the process was spinning.

Representative thread backtrace

  • Command: sshd-session: unknown [priv]
  • Why Fixer classified it this way: The trace is dominated by socket syscalls, which suggests the process is rapidly retrying or churning through network or IPC work.
  • Wait site: poll_schedule_timeout.constprop.0
  • Hot path: native_flush_tlb_one_user (21.96% sampled CPU)
  • Repeated loop: munmap -> munmap -> munmap
  • Top syscalls: munmap x17, read x4, getpid x3, sendto x3
  • Package: openssh-server 1:10.3p1-1
  • Kernel: 6.17.10+deb14-amd64
  • Distribution: debian
poll_schedule_timeout.constprop.0
do_sys_poll
__x64_sys_poll
do_syscall_64
entry_SYSCALL_64_after_hwframe

Possible duplicates

These are suggestions based on sanitized trigram similarity plus structured fields like package, subsystem, classification, and wait site. They are not auto-merged.

sshd-session is stuck in a likely unclassified userspace loop: 24.39% of sampled CPU passed through native_flush_tlb_one_user, with repeated thread backtraces show 1 thread(s) around 0x00007fc38ce9a7d2 in ?? () from target:<path>.

highpackage: openssh-serversource: opensshscore: 106reports: 2patch attempt readysimilarity: 97%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-05-17 16:54 UTC. Public page: /issues/019e0b30-1564-7f53-89d6-615f456eb98e. Public JSON: /v1/issues/019e0b30-1564-7f53-89d6-615f456eb98e

sshd-session is stuck in a likely unclassified userspace loop: 21.97% of sampled CPU passed through unmap_vmas, with repeated thread backtraces show 1 thread(s) around 0x00007f8fa7c9a7d2 in ?? () from target:<path>.

highpackage: openssh-serversource: opensshscore: 106reports: 2patch attempt readysimilarity: 79%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-05-18 09:57 UTC. Public page: /issues/019e3974-86e3-7021-8ac6-1c08dfe2d29d. Public JSON: /v1/issues/019e3974-86e3-7021-8ac6-1c08dfe2d29d

sshd-session is stuck in a likely unclassified userspace loop: 59.49% of sampled CPU passed through __free_one_page, with repeated thread backtraces show 1 thread(s) around 0x00007fc38ce9a7d2 in ?? () from target:<path>.

highpackage: openssh-serversource: opensshscore: 106reports: 2patch attempt readysimilarity: 79%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-05-18 03:11 UTC. Public page: /issues/019e36ed-9368-71d2-93bc-ea96cfa15d92. Public JSON: /v1/issues/019e36ed-9368-71d2-93bc-ea96cfa15d92

sshd-session is stuck in a likely unclassified userspace loop: 20.65% of sampled CPU passed through get_pid_task, with repeated thread backtraces show 1 thread(s) around 0x00007f202289a7d2 in ?? () from target:<path>.

highpackage: openssh-serversource: opensshscore: 106reports: 2patch attempt readysimilarity: 78%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-05-14 21:04 UTC. Public page: /issues/019e2683-8ae8-7de2-ac7c-52a3f304c75f. Public JSON: /v1/issues/019e2683-8ae8-7de2-ac7c-52a3f304c75f

sshd-session is stuck in a likely unclassified userspace loop: 23.56% of sampled CPU passed through __netlink_lookup, with repeated thread backtraces show 1 thread(s) around 0x00007f8df049a7d2 in ?? () from target:<path>.

highpackage: openssh-serversource: opensshscore: 106reports: 2patch attempt readysimilarity: 77%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-05-15 15:18 UTC. Public page: /issues/019e2b9e-99ce-7600-8349-839372ff8b38. Public JSON: /v1/issues/019e2b9e-99ce-7600-8349-839372ff8b38

sshd-session is stuck in a likely unclassified userspace loop: 100.00% of sampled CPU passed through nf_ct_get_tuple, with repeated thread backtraces show 1 thread(s) around 0x00007f9d21c9a7d2 in ?? () from target:<path>.

highpackage: openssh-serversource: opensshscore: 106reports: 2patch attempt readysimilarity: 77%

Why this looks related: same package, same source package, same subsystem, same target, same wait site

Last seen: 2026-05-15 15:53 UTC. Public page: /issues/019dfd2e-6077-7a51-b6b8-e030a863fa21. Public JSON: /v1/issues/019dfd2e-6077-7a51-b6b8-e030a863fa21

Worker outcome summary

This issue has 6 recorded worker attempts. Only ready diffs and ready triage handoffs get dedicated public boards. Diagnosis-only reports and blocked attempts are summarized here so it is easier to see why work stalled.

2 ready patch attempts
4 diagnosis-only reports

No ready triage handoffs, failed patch attempts, explained impossible attempts, or other attempt states.

Published attempts

ready patch attempt

patch

sshd-session likely remains stuck in a socket churn loop. A diagnosis report and patch proposal were created locally.

state: readycreated: 2026-05-13 14:03 UTCvalidation: ready
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing. The workspace currently changes these repo-relative paths: log.c. Verify that `## Git Add Paths` matches this exact set and that `## Issue Connection` explains every shipped functional file.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. The latest author response is at `./patch-output.txt`. Inspect the current code and changed paths like a strict code reviewer. Focus on correctness, regressions, maintainability, awkward control flow such as avoidable `goto`, missing validation, weak or non-gittable commit message text, and explanations that fail to connect the observed issue evidence to the code change. Also review the maintainer experience: the patch mail should be easy to accept upstream, the user-visible bug should be explained in plain language, subsystem-specific jargon should be defined when first used, and any non-obvious state translation or index remapping in code should have a short explanatory comment. Reject patches that omit `## Evidence Confidence`, use anything other than `reproduced`, `observed`, or `inferred`, or sound more certain than that evidence level allows. Reject patches that claim `reproduced` unless `## Validation` names the concrete reproduction command or test and its result. Reject patches that invent a reproducer, command line, crash, or user-visible failure not present in the evidence bundle; indirect profiler or strace evidence may justify a cautious mitigation, but the author must say it is indirect instead of presenting it as a confirmed upstream bug. Reject patches that introduce generic libc/std APIs when nearby code or project docs provide a local compat/helper API for the same job, unless the author explicitly justifies the exception. Reject validation that only reports a leaf object/syntax build when a project-level configure/build/test entrypoint exists and was not attempted; if a full build cannot run, the author must show the exact failed command and blocker.

Do not apply code changes in this pass.

Return a short markdown review report. The first non-empty line must be exactly one of:

RESULT: ok
RESULT: fix-needed

If you choose `RESULT: fix-needed`, add a `## Findings` section with concrete, actionable items.

## Refinement Pass 1

You are refining a fixer patch after an explicit code review.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Read the latest author response at `./patch-output.txt`. Read the review report at `./review-1-output.txt`. This is refinement round 1. The original pre-edit snapshot is available at `./source` if you need to compare the current patch against it. Re-read the planning pass at `./plan-output.txt` before editing. The workspace currently changes these repo-relative paths: log.c. Either keep that exact set synchronized with `## Git Add Paths` and `## Issue Connection`, or revert any unintended file before you answer.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. Address the review findings with the smallest reasonable follow-up changes. If the review identifies a runtime or correctness bug in the changed code, you must update the code itself before answering; a metadata-only response is not sufficient. Keep the patch upstream-friendly, use local project helpers and compat APIs when available, avoid awkward control flow when a simpler structure w

[truncated 6832 bytes]

Response

## Plan Pass

## Problem
Fixer observed `sshd-session` doing repeated `/dev/log` syslog socket work while draining preauth/PAM failure logs for an invalid user, followed by PAM teardown `munmap()` activity. The evidence does not prove an infinite loop or a user-visible failure; it supports a targeted mitigation for avoidable per-message syslog socket churn in the privileged monitor path.

## Evidence Confidence
observed

## Proposed Subject
`log: avoid reopening syslog for each daemon log message`

## Patch Plan
Change the upstream `log.c` logging path so daemon logging does not call `openlog()`/`syslog()`/`closelog()` for every message after `log_init()` has selected the program name, facility, and stderr mode. Keep the existing `log_init()` convention that reinitializes logging after rexec/fork/config parsing, but make normal `do_log()` syslog emission reuse the initialized syslog state where possible.

This directly addresses the observed signal: the strace excerpt shows `socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC)`, `connect("/dev/log")`, `sendto()`, and `close()` around preauth/PAM failure log messages. The implicated code path is `sshd-auth` child logs via `mm_log_handler()`, `monitor_read_log()` re-emits through `sshlogdirect()`, and `do_log()` currently reopens syslog per message.

Follow existing helpers and conventions: use `log_init()`/`do_log()` in `log.c`, `sshlogdirect()`, `fatal_f()`/`debug_f()`, and the monitor logging wrappers rather than adding caller-specific libc syslog calls. Avoid awkward control flow such as a new `goto`; this should be a bounded state update in `log_init()` plus a straight-line `do_log()` emission path.

No prior Fixer patch was found. Debian quilt has `syslog-level-silent.patch` touching `log.c`, but it is compatibility-only and should not be replaced; the planned change should be upstream-style and not Debian-local.

## Risks
Syslog state is process-global, so the change must preserve existing behavior across rexec, fork, daemonization, config-driven facility changes, and stderr logging. It must not regress the existing comment in `log_init()` about external libraries seeing the right facility after reexec. Threaded PAM code also means avoiding unsafe shared temporary `syslog_data` assumptions.

## Validation
First try the project entrypoint from the workspace root: `./configure && make`.

If that fails due to missing dependencies or generated files, record the exact failure and then run the narrowest reproducible check, likely `make log.o` after any successful configure step.

Add a cheap independent signal check: build a temporary logging harness against the changed `log.o` or use an existing built binary path that calls `log_init(..., on_stderr=0)`, then run `strace -e trace=socket,connect,sendto,close` over multiple log messages to compare that repeated daemon logs no longer reopen `/dev/log` per message. This will validate the mitigation, not claim the original production runaway was independently reproduced.

## Patch Pass

Subject: log: keep syslog open on non-openlog_r platforms

## Commit Message
Avoid closing and reopening the libc syslog connection for every daemon log message on platforms without `openlog_r()`. `log_init()` still reinitializes syslog when the program name or facility changes, but normal `syslog()` writes now reuse that state.

This targets monitor logging: the privileged `sshd-session` monitor drains pre-authentication child log messages and re-emits them through OpenSSH’s `log.c` helpers.

## Evidence Confidence
observed

## Issue Connection
Fixer observed `sshd-session` in a low-CPU sampled state with `/proc` showing it sleeping in `poll`, while strace showed pre-authentication invalid-user logging repeatedly opening a Unix datagram socket, connecting to `/dev/log`, sending syslog messages, and closing the socket. This failure was observed by Fixer and not independently reproduced.

The code-level cause is that the non-`openlog_r()` path in `do_log()` called `openlog()`, `syslog()`, and `closelog()` for every daemon log message. The patch keeps syslog open between messages on that fallback path, while preserving the existing per-call `openlog_r()` path because it uses a local `struct syslog_data` and should remain reentrant.

The expected effect is to reduce `/dev/log` socket churn when the monitor drains bursts of pre-authentication or PAM failure logs. I followed the existing OpenSSH logging helpers (`log_init()`, `sshlogdirect()`, `do_log()`) and monitor logging convention (`mm_log_handler()` / `monitor_read_log()`); no new process, networking, allocation, or locking API was introduced. I changed course slightly from the saved plan by leaving the `openlog_r()` path unchanged after inspecting the code, to avoid introducing shared reentrant syslog state.

## Git Add Paths
log.c

## Validation
`./configure && make` failed from the workspace root with: `configure: error: ./configure.ac newer than configure, run autoreconf`.

After that generated-file blocker, I ran the narrow reproducible check: `autoreconf && ./configure && make log.o`. It succeeded. Configure reported `checking for openlog_r... no`, so this build exercised the changed fallback path. The compile produced existing `log.c` format-truncation warnings unrelated to this change.

Independent signal check: `strace -e trace=socket,connect,sendto,close /tmp/fixer-log-smoke` was attempted but blocked by container ptrace permissions: `PTRACE_TRACEME: Operation not permitted`. As a fallback smoke check, I compiled a temporary counter harness around `log.c`; two daemon log messages produced `openlog=1 syslog=2 closelog=0`, confirming the changed path no longer closes/reopens syslog per message.

`git diff --check` passed.

## Review Pass 1

RESULT: fix-needed

## Findings
- [log.c:430](./workspace/log.c:430) The patch stops refreshing OpenSSH’s syslog identity/facility before each daemon log write on non-`openlog_r()` platforms. Syslog state is process-global, and this same code comment already calls out external libraries such as libwrap as users of syslog in the same process. If a PAM/libwrap-style library calls `openlog()` after `log_init()`, subsequent OpenSSH `syslog()` calls can inherit that library’s ident/facility because `syslog_open` remains true and `do_log()` no longer calls `openlog(progname, LOG_PID, log_facility)`. The patch needs to preserve OpenSSH’s ident/facility for its own log writes while still avoiding the observed per-message `/dev/log` close/reopen churn, or explicitly constrain the optimization to cases where external syslog state cannot be clobbered.

- [log.c:273](./workspace/log.c:273) The existing comment now says `log_init()` forces an “open/close of syslog”, but the fallback path now opens and intentionally leaves syslog open. Update the maintainer-facing comment to describe the new invariant accurately; otherwise the code and comment contradict each other in the exact area the patch is changing.

Git Add Paths matches the current changed path set (`log.c`), and the patch mail uses `observed` appropriately rather than claiming local reproduction.

## Refinement Pass 1

Subject: log: avoid closing syslog after each message

## Commit Message
On platforms without `openlog_r()`, keep the libc syslog connection open between daemon log messages instead of closing it after every write. OpenSSH still calls `openlog()` before each `syslog()` write so its program name and facility are restored if another library touched the process-global syslog state.

## Evidence Confidence
observed

## Issue Connection
Fixer observed `sshd-session` in a low-CPU sampled state with `/proc` showing it sleeping in `poll`, while strace showed pre-authentication invalid-user logging repeatedly opening a Unix datagram socket, connecting to `/dev/log`, sending syslog messages, and closing the socket. This failure was observed by Fixer and not independently reproduced.

The code-level cause is that the non-`openlog_r()` path in `log.c` called `openlog()`, `syslog()`, and `closelog()` for every daemon log message. I changed only that fallback path: `log_init()` still closes and reopens syslog when OpenSSH’s logging identity changes, and `do_log()` still calls `openlog()` before each write to preserve OpenSSH’s ident/facility after PAM, libwrap, or another library uses process-global syslog state, but it no longer calls `closelog()` after every message.

The expected effect is to reduce `/dev/log` socket close/reopen churn during bursts of monitor logging while preserving the existing protection against external-library syslog state changes. This refinement addresses both review findings: the code now refreshes OpenSSH’s syslog identity before each write, and the stale “open/close” comment was corrected. I used the existing OpenSSH logging helpers and monitor logging convention (`log_init()`, `do_log()`, `sshlogdirect()`, `mm_log_handler()` / `monitor_read_log()`), and added a short comment for the process-global syslog invariant.

## Git Add Paths
log.c

## Validation
`./configure && make` passed from the workspace root. The build reported existing warnings in unrelated files.

`make check` was attempted, but this generated Makefile has no such target: `make: *** No rule to make target 'check'.  Stop.`

Independent smoke check: I compiled a temporary counter harness around `log.c` and emitted two daemon log messages through `logit()`. It reported `openlog=3 syslog=2 closelog=0`, confirming the refined path refreshes syslog state for `log_init()` plus each OpenSSH log write while avoiding per-message `closelog()`.

`git diff --check` passed.

## Review Pass 2

RESULT: ok

The refined patch addresses the prior correctness concern: the fallback path still calls `openlog()` before each OpenSSH `syslog()` write to restore process-global ident/facility, but no longer calls `closelog()` after each message. The updated comment now matches the new behavior.

`## Git Add Paths` matches the current changed path set: `log.c`. The `## Issue Connection` explains the only shipped functional file and stays within the observed Fixer evidence without claiming local reproduction. Validation includes the project-level `./configure && make`, the unavailable `make check` target, a bounded smoke check, and `git diff --check`.

Diff

diff --git a/log.c b/log.c
index 21a3a3c..59ea3b4 100644
--- a/log.c
+++ b/log.c
@@ -63,6 +63,10 @@ static log_handler_fn *log_handler;
 static void *log_handler_ctx;
 static char **log_verbose;
 static size_t nlog_verbose;
+#if !(defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT))
+/* log_init() closes/reopens syslog when program identity or facility changes. */
+static int syslog_open;
+#endif
 extern char *__progname;
 
 #define LOG_SYSLOG_VIS	(VIS_CSTYLE|VIS_NL|VIS_TAB|VIS_OCTAL)
@@ -210,6 +214,12 @@ log_init(const char *av0, LogLevel level, SyslogFacility facility,
 	log_handler = NULL;
 	log_handler_ctx = NULL;
 
+#if !(defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT))
+	if (syslog_open) {
+		closelog();
+		syslog_open = 0;
+	}
+#endif
 	log_on_stderr = on_stderr;
 	if (on_stderr)
 		return;
@@ -263,14 +273,14 @@ log_init(const char *av0, LogLevel level, SyslogFacility facility,
 	/*
 	 * If an external library (eg libwrap) attempts to use syslog
 	 * immediately after reexec, syslog may be pointing to the wrong
-	 * facility, so we force an open/close of syslog here.
+	 * facility, so we force a syslog reinitialisation here.
 	 */
 #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
 	openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
 	closelog_r(&sdata);
 #else
 	openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
-	closelog();
+	syslog_open = 1;
 #endif
 }
 
@@ -417,9 +427,10 @@ do_log(LogLevel level, int force, const char *suffix, const char *fmt,
 		syslog_r(pri, &sdata, "%.500s", fmtbuf);
 		closelog_r(&sdata);
 #else
+		/* Reset process-global syslog state without closing the socket. */
 		openlog(progname, LOG_PID, log_facility);
+		syslog_open = 1;
 		syslog(pri, "%.500s", fmtbuf);
-		closelog();
 #endif
 	}
 	errno = saved_errno;

ready patch attempt

patch

sshd-session likely remains stuck in a socket churn loop. A diagnosis report and patch proposal were created locally.

state: readycreated: 2026-05-13 14:03 UTCvalidation: ready
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing. The workspace currently changes these repo-relative paths: log.c. Verify that `## Git Add Paths` matches this exact set and that `## Issue Connection` explains every shipped functional file.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. The latest author response is at `./patch-output.txt`. Inspect the current code and changed paths like a strict code reviewer. Focus on correctness, regressions, maintainability, awkward control flow such as avoidable `goto`, missing validation, weak or non-gittable commit message text, and explanations that fail to connect the observed issue evidence to the code change. Also review the maintainer experience: the patch mail should be easy to accept upstream, the user-visible bug should be explained in plain language, subsystem-specific jargon should be defined when first used, and any non-obvious state translation or index remapping in code should have a short explanatory comment. Reject patches that omit `## Evidence Confidence`, use anything other than `reproduced`, `observed`, or `inferred`, or sound more certain than that evidence level allows. Reject patches that claim `reproduced` unless `## Validation` names the concrete reproduction command or test and its result. Reject patches that invent a reproducer, command line, crash, or user-visible failure not present in the evidence bundle; indirect profiler or strace evidence may justify a cautious mitigation, but the author must say it is indirect instead of presenting it as a confirmed upstream bug. Reject patches that introduce generic libc/std APIs when nearby code or project docs provide a local compat/helper API for the same job, unless the author explicitly justifies the exception. Reject validation that only reports a leaf object/syntax build when a project-level configure/build/test entrypoint exists and was not attempted; if a full build cannot run, the author must show the exact failed command and blocker.

Do not apply code changes in this pass.

Return a short markdown review report. The first non-empty line must be exactly one of:

RESULT: ok
RESULT: fix-needed

If you choose `RESULT: fix-needed`, add a `## Findings` section with concrete, actionable items.

## Refinement Pass 1

You are refining a fixer patch after an explicit code review.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Read the latest author response at `./patch-output.txt`. Read the review report at `./review-1-output.txt`. This is refinement round 1. The original pre-edit snapshot is available at `./source` if you need to compare the current patch against it. Re-read the planning pass at `./plan-output.txt` before editing. The workspace currently changes these repo-relative paths: log.c. Either keep that exact set synchronized with `## Git Add Paths` and `## Issue Connection`, or revert any unintended file before you answer.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`, `make` and, if available, `make check`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. Address the review findings with the smallest reasonable follow-up changes. If the review identifies a runtime or correctness bug in the changed code, you must update the code itself before answering; a metadata-only response is not sufficient. Keep the patch upstream-friendly, use local project helpers and compat APIs when available, avoid awkward control flow when a simpler structure w

[truncated 6832 bytes]

Response

## Plan Pass

## Problem
Fixer observed `sshd-session` doing repeated `/dev/log` syslog socket work while draining preauth/PAM failure logs for an invalid user, followed by PAM teardown `munmap()` activity. The evidence does not prove an infinite loop or a user-visible failure; it supports a targeted mitigation for avoidable per-message syslog socket churn in the privileged monitor path.

## Evidence Confidence
observed

## Proposed Subject
`log: avoid reopening syslog for each daemon log message`

## Patch Plan
Change the upstream `log.c` logging path so daemon logging does not call `openlog()`/`syslog()`/`closelog()` for every message after `log_init()` has selected the program name, facility, and stderr mode. Keep the existing `log_init()` convention that reinitializes logging after rexec/fork/config parsing, but make normal `do_log()` syslog emission reuse the initialized syslog state where possible.

This directly addresses the observed signal: the strace excerpt shows `socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC)`, `connect("/dev/log")`, `sendto()`, and `close()` around preauth/PAM failure log messages. The implicated code path is `sshd-auth` child logs via `mm_log_handler()`, `monitor_read_log()` re-emits through `sshlogdirect()`, and `do_log()` currently reopens syslog per message.

Follow existing helpers and conventions: use `log_init()`/`do_log()` in `log.c`, `sshlogdirect()`, `fatal_f()`/`debug_f()`, and the monitor logging wrappers rather than adding caller-specific libc syslog calls. Avoid awkward control flow such as a new `goto`; this should be a bounded state update in `log_init()` plus a straight-line `do_log()` emission path.

No prior Fixer patch was found. Debian quilt has `syslog-level-silent.patch` touching `log.c`, but it is compatibility-only and should not be replaced; the planned change should be upstream-style and not Debian-local.

## Risks
Syslog state is process-global, so the change must preserve existing behavior across rexec, fork, daemonization, config-driven facility changes, and stderr logging. It must not regress the existing comment in `log_init()` about external libraries seeing the right facility after reexec. Threaded PAM code also means avoiding unsafe shared temporary `syslog_data` assumptions.

## Validation
First try the project entrypoint from the workspace root: `./configure && make`.

If that fails due to missing dependencies or generated files, record the exact failure and then run the narrowest reproducible check, likely `make log.o` after any successful configure step.

Add a cheap independent signal check: build a temporary logging harness against the changed `log.o` or use an existing built binary path that calls `log_init(..., on_stderr=0)`, then run `strace -e trace=socket,connect,sendto,close` over multiple log messages to compare that repeated daemon logs no longer reopen `/dev/log` per message. This will validate the mitigation, not claim the original production runaway was independently reproduced.

## Patch Pass

Subject: log: keep syslog open on non-openlog_r platforms

## Commit Message
Avoid closing and reopening the libc syslog connection for every daemon log message on platforms without `openlog_r()`. `log_init()` still reinitializes syslog when the program name or facility changes, but normal `syslog()` writes now reuse that state.

This targets monitor logging: the privileged `sshd-session` monitor drains pre-authentication child log messages and re-emits them through OpenSSH’s `log.c` helpers.

## Evidence Confidence
observed

## Issue Connection
Fixer observed `sshd-session` in a low-CPU sampled state with `/proc` showing it sleeping in `poll`, while strace showed pre-authentication invalid-user logging repeatedly opening a Unix datagram socket, connecting to `/dev/log`, sending syslog messages, and closing the socket. This failure was observed by Fixer and not independently reproduced.

The code-level cause is that the non-`openlog_r()` path in `do_log()` called `openlog()`, `syslog()`, and `closelog()` for every daemon log message. The patch keeps syslog open between messages on that fallback path, while preserving the existing per-call `openlog_r()` path because it uses a local `struct syslog_data` and should remain reentrant.

The expected effect is to reduce `/dev/log` socket churn when the monitor drains bursts of pre-authentication or PAM failure logs. I followed the existing OpenSSH logging helpers (`log_init()`, `sshlogdirect()`, `do_log()`) and monitor logging convention (`mm_log_handler()` / `monitor_read_log()`); no new process, networking, allocation, or locking API was introduced. I changed course slightly from the saved plan by leaving the `openlog_r()` path unchanged after inspecting the code, to avoid introducing shared reentrant syslog state.

## Git Add Paths
log.c

## Validation
`./configure && make` failed from the workspace root with: `configure: error: ./configure.ac newer than configure, run autoreconf`.

After that generated-file blocker, I ran the narrow reproducible check: `autoreconf && ./configure && make log.o`. It succeeded. Configure reported `checking for openlog_r... no`, so this build exercised the changed fallback path. The compile produced existing `log.c` format-truncation warnings unrelated to this change.

Independent signal check: `strace -e trace=socket,connect,sendto,close /tmp/fixer-log-smoke` was attempted but blocked by container ptrace permissions: `PTRACE_TRACEME: Operation not permitted`. As a fallback smoke check, I compiled a temporary counter harness around `log.c`; two daemon log messages produced `openlog=1 syslog=2 closelog=0`, confirming the changed path no longer closes/reopens syslog per message.

`git diff --check` passed.

## Review Pass 1

RESULT: fix-needed

## Findings
- [log.c:430](./workspace/log.c:430) The patch stops refreshing OpenSSH’s syslog identity/facility before each daemon log write on non-`openlog_r()` platforms. Syslog state is process-global, and this same code comment already calls out external libraries such as libwrap as users of syslog in the same process. If a PAM/libwrap-style library calls `openlog()` after `log_init()`, subsequent OpenSSH `syslog()` calls can inherit that library’s ident/facility because `syslog_open` remains true and `do_log()` no longer calls `openlog(progname, LOG_PID, log_facility)`. The patch needs to preserve OpenSSH’s ident/facility for its own log writes while still avoiding the observed per-message `/dev/log` close/reopen churn, or explicitly constrain the optimization to cases where external syslog state cannot be clobbered.

- [log.c:273](./workspace/log.c:273) The existing comment now says `log_init()` forces an “open/close of syslog”, but the fallback path now opens and intentionally leaves syslog open. Update the maintainer-facing comment to describe the new invariant accurately; otherwise the code and comment contradict each other in the exact area the patch is changing.

Git Add Paths matches the current changed path set (`log.c`), and the patch mail uses `observed` appropriately rather than claiming local reproduction.

## Refinement Pass 1

Subject: log: avoid closing syslog after each message

## Commit Message
On platforms without `openlog_r()`, keep the libc syslog connection open between daemon log messages instead of closing it after every write. OpenSSH still calls `openlog()` before each `syslog()` write so its program name and facility are restored if another library touched the process-global syslog state.

## Evidence Confidence
observed

## Issue Connection
Fixer observed `sshd-session` in a low-CPU sampled state with `/proc` showing it sleeping in `poll`, while strace showed pre-authentication invalid-user logging repeatedly opening a Unix datagram socket, connecting to `/dev/log`, sending syslog messages, and closing the socket. This failure was observed by Fixer and not independently reproduced.

The code-level cause is that the non-`openlog_r()` path in `log.c` called `openlog()`, `syslog()`, and `closelog()` for every daemon log message. I changed only that fallback path: `log_init()` still closes and reopens syslog when OpenSSH’s logging identity changes, and `do_log()` still calls `openlog()` before each write to preserve OpenSSH’s ident/facility after PAM, libwrap, or another library uses process-global syslog state, but it no longer calls `closelog()` after every message.

The expected effect is to reduce `/dev/log` socket close/reopen churn during bursts of monitor logging while preserving the existing protection against external-library syslog state changes. This refinement addresses both review findings: the code now refreshes OpenSSH’s syslog identity before each write, and the stale “open/close” comment was corrected. I used the existing OpenSSH logging helpers and monitor logging convention (`log_init()`, `do_log()`, `sshlogdirect()`, `mm_log_handler()` / `monitor_read_log()`), and added a short comment for the process-global syslog invariant.

## Git Add Paths
log.c

## Validation
`./configure && make` passed from the workspace root. The build reported existing warnings in unrelated files.

`make check` was attempted, but this generated Makefile has no such target: `make: *** No rule to make target 'check'.  Stop.`

Independent smoke check: I compiled a temporary counter harness around `log.c` and emitted two daemon log messages through `logit()`. It reported `openlog=3 syslog=2 closelog=0`, confirming the refined path refreshes syslog state for `log_init()` plus each OpenSSH log write while avoiding per-message `closelog()`.

`git diff --check` passed.

## Review Pass 2

RESULT: ok

The refined patch addresses the prior correctness concern: the fallback path still calls `openlog()` before each OpenSSH `syslog()` write to restore process-global ident/facility, but no longer calls `closelog()` after each message. The updated comment now matches the new behavior.

`## Git Add Paths` matches the current changed path set: `log.c`. The `## Issue Connection` explains the only shipped functional file and stays within the observed Fixer evidence without claiming local reproduction. Validation includes the project-level `./configure && make`, the unavailable `make check` target, a bounded smoke check, and `git diff --check`.

Diff

diff --git a/log.c b/log.c
index 21a3a3c..59ea3b4 100644
--- a/log.c
+++ b/log.c
@@ -63,6 +63,10 @@ static log_handler_fn *log_handler;
 static void *log_handler_ctx;
 static char **log_verbose;
 static size_t nlog_verbose;
+#if !(defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT))
+/* log_init() closes/reopens syslog when program identity or facility changes. */
+static int syslog_open;
+#endif
 extern char *__progname;
 
 #define LOG_SYSLOG_VIS	(VIS_CSTYLE|VIS_NL|VIS_TAB|VIS_OCTAL)
@@ -210,6 +214,12 @@ log_init(const char *av0, LogLevel level, SyslogFacility facility,
 	log_handler = NULL;
 	log_handler_ctx = NULL;
 
+#if !(defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT))
+	if (syslog_open) {
+		closelog();
+		syslog_open = 0;
+	}
+#endif
 	log_on_stderr = on_stderr;
 	if (on_stderr)
 		return;
@@ -263,14 +273,14 @@ log_init(const char *av0, LogLevel level, SyslogFacility facility,
 	/*
 	 * If an external library (eg libwrap) attempts to use syslog
 	 * immediately after reexec, syslog may be pointing to the wrong
-	 * facility, so we force an open/close of syslog here.
+	 * facility, so we force a syslog reinitialisation here.
 	 */
 #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
 	openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
 	closelog_r(&sdata);
 #else
 	openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
-	closelog();
+	syslog_open = 1;
 #endif
 }
 
@@ -417,9 +427,10 @@ do_log(LogLevel level, int force, const char *suffix, const char *fmt,
 		syslog_r(pri, &sdata, "%.500s", fmtbuf);
 		closelog_r(&sdata);
 #else
+		/* Reset process-global syslog state without closing the socket. */
 		openlog(progname, LOG_PID, log_facility);
+		syslog_open = 1;
 		syslog(pri, "%.500s", fmtbuf);
-		closelog();
 #endif
 	}
 	errno = saved_errno;

diagnosis-only report

report

sshd-session likely remains stuck in a socket churn loop. A diagnosis report and patch proposal were created locally.

state: readycreated: 2026-05-13 12:46 UTCvalidation: ready
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. The latest author response is at `./patch-output.txt`. Inspect the current code and changed paths like a strict code reviewer. Focus on correctness, regressions, maintainability, awkward control flow such as avoidable `goto`, missing validation, weak or non-gittable commit message text, and explanations that fail to connect the observed issue evidence to the code change. Also review the maintainer experience: the patch mail should be easy to accept upstream, the user-visible bug should be explained in plain language, subsystem-specific jargon should be defined when first used, and any non-obvious state translation or index remapping in code should have a short explanatory comment. Reject patches that omit `## Evidence Confidence`, use anything other than `reproduced`, `observed`, or `inferred`, or sound more certain than that evidence level allows. Reject patches that claim `reproduced` unless `## Validation` names the concrete reproduction command or test and its result. Reject patches that invent a reproducer, command line, crash, or user-visible failure not present in the evidence bundle; indirect profiler or strace evidence may justify a cautious mitigation, but the author must say it is indirect instead of presenting it as a confirmed upstream bug. Reject patches that introduce generic libc/std APIs when nearby code or project docs provide a local compat/helper API for the same job, unless the author explicitly justifies the exception. Reject validation that only reports a leaf object/syntax build when a project-level configure/build/test entrypoint exists and was not attempted; if a full build cannot run, the author must show the exact failed command and blocker.

Do not apply code changes in this pass.

Return a short markdown review report. The first non-empty line must be exactly one of:

RESULT: ok
RESULT: fix-needed

If you choose `RESULT: fix-needed`, add a `## Findings` section with concrete, actionable items.

Response

## Plan Pass

## Problem
Fixer flagged `sshd-session: unknown [priv]` as a runaway/socket-churn process, but the evidence shows a sleeping preauth monitor in `poll()` with only 0.2% total CPU across three processes. The strace excerpt shows normal preauth failure teardown: child log messages forwarded to syslog, `wait4()` for the auth child, then PAM/library cleanup `munmap()` calls.

## Evidence Confidence
inferred

The bundle has profiler/strace excerpts, not an independent reproducer. The sampled stack is blocked in `poll_schedule_timeout`, and the syscall burst is short cleanup/logging activity. This is not strong enough for an upstream source patch claiming a confirmed OpenSSH bug.

## Proposed Subject
No source patch yet: diagnose likely false-positive `sshd-session` runaway report and require stronger evidence before changing OpenSSH monitor or logging behavior.

## Patch Plan
Do not edit files in this pass. A source patch would be speculative because the apparent hot path maps to existing intended code paths: `monitor_read()` polls the monitor/log fds, `monitor_read_log()` forwards child logs through `sshlogdirect()`, and `log.c` intentionally uses OpenSSH logging wrappers around syslog.

If stronger evidence is collected later, target the smallest relevant area: preauth monitor/log forwarding in `monitor.c`, `monitor_wrap.c`, `log.c`, and PAM max-tries handling in `auth-pam.c`. Follow local conventions and helpers: `sshbuf`, `atomicio`, `fatal_f`/`fatal_fr`, `debug_f`, `sshlogdirect`, `set_log_handler(mm_log_handler, ...)`, `xcalloc`/`xrecallocarray`, and OpenSSH’s direct bounded control flow. I found no prior Fixer patch to replace; only the prompt/evidence bundle references this finding.

Avoid awkward control flow such as adding cleanup `goto`s around the monitor loop. Any future patch should preserve the existing bounded loop shape unless a reproduced busy-loop condition is found.

## Risks
Changing syslog open/close behavior could affect daemon logging semantics and the existing comment in `log_init()` about external libraries and syslog facility state.

Changing preauth monitor polling could break privilege-separation IPC or lose child log messages. The current evidence does not show a spin: it shows `poll()` sleep and normal disconnect/auth failure logging.

## Validation
Before reporting any patch as ready, try the workspace-root project entrypoint:

`./configure && make`

If that fails due to missing dependencies or generated files, report the exact command and failure, then run the narrowest reproducible compile such as rebuilding `monitor.o`, `monitor_wrap.o`, `log.o`, or `auth-pam.o` after `configure`.

For bounded independent reproduction before any source edit, run a local test `sshd`/`sshd-session` with PAM enabled if available, trigger a few invalid password attempts, and capture a short `strace -f` or `perf stat` around the preauth session. Only upgrade confidence to `reproduced` if that command actually shows a busy loop or excessive repeated `/dev/log` churn beyond normal auth failure logging.

## Patch Pass

Subject: diagnose sshd-session preauth poll sample

## Commit Message
No source change. The likely root cause is a profiler false positive: the sampled `sshd-session` was a preauth monitor process sleeping in `poll()`, then forwarding normal child authentication logs and cleaning up after a failed invalid-user connection.

The inspected OpenSSH code already uses the local monitor, logging, buffer, and IO helpers for this path: `monitor_read()`, `monitor_read_log()`, `mm_log_handler()`, `sshbuf`, `atomicio`, `sshlogdirect`, and `fatal_f`/`fatal_fr`. Changing this path without a reproduced spin or stronger trace would be speculative and not upstream-ready.

## Evidence Confidence
inferred

## Issue Connection
Fixer collected a 3-second profile and 5-second strace for `sshd-session: unknown [priv]`. The profile reported kernel time in `native_flush_tlb_one_user` and `__x64_sys_poll`, while `/proc` showed the process in `S (sleeping)` with `wchan` at `poll_schedule_timeout.constprop.0` and only 0.2% total CPU across three `sshd-session` processes.

The cautious code-level inference is that this was normal OpenSSH preauth monitor activity, not a demonstrated runaway loop. The strace shows the monitor reading a child log message, sending it to `/dev/log`, observing the child/log pipes close, reaping the auth child with status 255, logging PAM max-tries messages, and then unmapping libraries during cleanup. That maps directly to `monitor_read()`, `monitor_read_log()`, `mm_log_handler()`, and PAM max-tries handling.

I made no source change, following the saved plan at `plan-output.txt`. The expected effect is to avoid landing a speculative OpenSSH patch from indirect profiler evidence; an upstream report should instead ask for a longer trace or a local reproduction showing a tight monitor/log/syslog loop with sustained CPU.

## Git Add Paths
None

## Validation
Checked upstream/project guidance: only `README.md` matched the requested contribution/style doc search. It documents the normal Portable OpenSSH `./configure`, `make`, and `make tests` flow. No separate `CONTRIBUTING`, `HACKING`, `README-hacking`, `docs/`, or `dev-docs/` entry was present.

Inspected local helper conventions in the touched subsystem: OpenSSH uses `sshbuf` for monitor messages, `atomicio` for fd IO, `sshlogdirect`/`set_log_handler(mm_log_handler, ...)` for privsep logging, `fatal_f`/`fatal_fr` for fatal errors, and `xcalloc`/`xrecallocarray` for allocation. No generic replacement API was introduced.

Ran project-level entrypoint from the workspace root:
`./configure && make`
Result: failed immediately with `configure: error: ./configure.ac newer than configure, run autoreconf`.

Because the workspace has no generated `Makefile` or `config.h`, I ran the narrow focused fallback in a temporary copy to avoid generated-file churn:
`autoreconf && ./configure && make monitor.o monitor_wrap.o log.o auth-pam.o`
Result: succeeded. `configure` detected `PAM support: no` in this environment, so this was a compile check for the relevant monitor/log/PAM source files, not a runtime PAM reproduction.

Bounded independent reproduction attempt:
`./sshd-session -h`
Result: blocked because `./sshd-session` was not built in the workspace (`No such file or directory`). A realistic invalid-login runtime reproduction was also blocked by the failed root build entrypoint and the fallback configuration lacking PAM headers/support, so confidence remains `inferred`.

## Review Pass 1

RESULT: ok

No source changes are present, and `## Git Add Paths` correctly says `None`. The author kept confidence at `inferred`, did not invent a reproducer, and connected the profiler/strace evidence to the existing OpenSSH preauth monitor/logging path without overstating it as a confirmed bug.

Validation is acceptable for a no-patch diagnosis: `./configure && make` was attempted from the workspace root and failed with the exact generated-file blocker, then a focused compile was run in a temporary regenerated copy. The report also names the relevant local helpers and conventions (`sshbuf`, `atomicio`, `sshlogdirect`, `mm_log_handler`, `fatal_f`/`fatal_fr`) and explains why no upstreamable source patch should be landed from the current evidence.

diagnosis-only report

report

sshd-session likely remains stuck in a socket churn loop. A diagnosis report and patch proposal were created locally.

state: readycreated: 2026-05-13 12:46 UTCvalidation: ready
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. The latest author response is at `./patch-output.txt`. Inspect the current code and changed paths like a strict code reviewer. Focus on correctness, regressions, maintainability, awkward control flow such as avoidable `goto`, missing validation, weak or non-gittable commit message text, and explanations that fail to connect the observed issue evidence to the code change. Also review the maintainer experience: the patch mail should be easy to accept upstream, the user-visible bug should be explained in plain language, subsystem-specific jargon should be defined when first used, and any non-obvious state translation or index remapping in code should have a short explanatory comment. Reject patches that omit `## Evidence Confidence`, use anything other than `reproduced`, `observed`, or `inferred`, or sound more certain than that evidence level allows. Reject patches that claim `reproduced` unless `## Validation` names the concrete reproduction command or test and its result. Reject patches that invent a reproducer, command line, crash, or user-visible failure not present in the evidence bundle; indirect profiler or strace evidence may justify a cautious mitigation, but the author must say it is indirect instead of presenting it as a confirmed upstream bug. Reject patches that introduce generic libc/std APIs when nearby code or project docs provide a local compat/helper API for the same job, unless the author explicitly justifies the exception. Reject validation that only reports a leaf object/syntax build when a project-level configure/build/test entrypoint exists and was not attempted; if a full build cannot run, the author must show the exact failed command and blocker.

Do not apply code changes in this pass.

Return a short markdown review report. The first non-empty line must be exactly one of:

RESULT: ok
RESULT: fix-needed

If you choose `RESULT: fix-needed`, add a `## Findings` section with concrete, actionable items.

Response

## Plan Pass

## Problem
Fixer flagged `sshd-session: unknown [priv]` as a runaway/socket-churn process, but the evidence shows a sleeping preauth monitor in `poll()` with only 0.2% total CPU across three processes. The strace excerpt shows normal preauth failure teardown: child log messages forwarded to syslog, `wait4()` for the auth child, then PAM/library cleanup `munmap()` calls.

## Evidence Confidence
inferred

The bundle has profiler/strace excerpts, not an independent reproducer. The sampled stack is blocked in `poll_schedule_timeout`, and the syscall burst is short cleanup/logging activity. This is not strong enough for an upstream source patch claiming a confirmed OpenSSH bug.

## Proposed Subject
No source patch yet: diagnose likely false-positive `sshd-session` runaway report and require stronger evidence before changing OpenSSH monitor or logging behavior.

## Patch Plan
Do not edit files in this pass. A source patch would be speculative because the apparent hot path maps to existing intended code paths: `monitor_read()` polls the monitor/log fds, `monitor_read_log()` forwards child logs through `sshlogdirect()`, and `log.c` intentionally uses OpenSSH logging wrappers around syslog.

If stronger evidence is collected later, target the smallest relevant area: preauth monitor/log forwarding in `monitor.c`, `monitor_wrap.c`, `log.c`, and PAM max-tries handling in `auth-pam.c`. Follow local conventions and helpers: `sshbuf`, `atomicio`, `fatal_f`/`fatal_fr`, `debug_f`, `sshlogdirect`, `set_log_handler(mm_log_handler, ...)`, `xcalloc`/`xrecallocarray`, and OpenSSH’s direct bounded control flow. I found no prior Fixer patch to replace; only the prompt/evidence bundle references this finding.

Avoid awkward control flow such as adding cleanup `goto`s around the monitor loop. Any future patch should preserve the existing bounded loop shape unless a reproduced busy-loop condition is found.

## Risks
Changing syslog open/close behavior could affect daemon logging semantics and the existing comment in `log_init()` about external libraries and syslog facility state.

Changing preauth monitor polling could break privilege-separation IPC or lose child log messages. The current evidence does not show a spin: it shows `poll()` sleep and normal disconnect/auth failure logging.

## Validation
Before reporting any patch as ready, try the workspace-root project entrypoint:

`./configure && make`

If that fails due to missing dependencies or generated files, report the exact command and failure, then run the narrowest reproducible compile such as rebuilding `monitor.o`, `monitor_wrap.o`, `log.o`, or `auth-pam.o` after `configure`.

For bounded independent reproduction before any source edit, run a local test `sshd`/`sshd-session` with PAM enabled if available, trigger a few invalid password attempts, and capture a short `strace -f` or `perf stat` around the preauth session. Only upgrade confidence to `reproduced` if that command actually shows a busy loop or excessive repeated `/dev/log` churn beyond normal auth failure logging.

## Patch Pass

Subject: diagnose sshd-session preauth poll sample

## Commit Message
No source change. The likely root cause is a profiler false positive: the sampled `sshd-session` was a preauth monitor process sleeping in `poll()`, then forwarding normal child authentication logs and cleaning up after a failed invalid-user connection.

The inspected OpenSSH code already uses the local monitor, logging, buffer, and IO helpers for this path: `monitor_read()`, `monitor_read_log()`, `mm_log_handler()`, `sshbuf`, `atomicio`, `sshlogdirect`, and `fatal_f`/`fatal_fr`. Changing this path without a reproduced spin or stronger trace would be speculative and not upstream-ready.

## Evidence Confidence
inferred

## Issue Connection
Fixer collected a 3-second profile and 5-second strace for `sshd-session: unknown [priv]`. The profile reported kernel time in `native_flush_tlb_one_user` and `__x64_sys_poll`, while `/proc` showed the process in `S (sleeping)` with `wchan` at `poll_schedule_timeout.constprop.0` and only 0.2% total CPU across three `sshd-session` processes.

The cautious code-level inference is that this was normal OpenSSH preauth monitor activity, not a demonstrated runaway loop. The strace shows the monitor reading a child log message, sending it to `/dev/log`, observing the child/log pipes close, reaping the auth child with status 255, logging PAM max-tries messages, and then unmapping libraries during cleanup. That maps directly to `monitor_read()`, `monitor_read_log()`, `mm_log_handler()`, and PAM max-tries handling.

I made no source change, following the saved plan at `plan-output.txt`. The expected effect is to avoid landing a speculative OpenSSH patch from indirect profiler evidence; an upstream report should instead ask for a longer trace or a local reproduction showing a tight monitor/log/syslog loop with sustained CPU.

## Git Add Paths
None

## Validation
Checked upstream/project guidance: only `README.md` matched the requested contribution/style doc search. It documents the normal Portable OpenSSH `./configure`, `make`, and `make tests` flow. No separate `CONTRIBUTING`, `HACKING`, `README-hacking`, `docs/`, or `dev-docs/` entry was present.

Inspected local helper conventions in the touched subsystem: OpenSSH uses `sshbuf` for monitor messages, `atomicio` for fd IO, `sshlogdirect`/`set_log_handler(mm_log_handler, ...)` for privsep logging, `fatal_f`/`fatal_fr` for fatal errors, and `xcalloc`/`xrecallocarray` for allocation. No generic replacement API was introduced.

Ran project-level entrypoint from the workspace root:
`./configure && make`
Result: failed immediately with `configure: error: ./configure.ac newer than configure, run autoreconf`.

Because the workspace has no generated `Makefile` or `config.h`, I ran the narrow focused fallback in a temporary copy to avoid generated-file churn:
`autoreconf && ./configure && make monitor.o monitor_wrap.o log.o auth-pam.o`
Result: succeeded. `configure` detected `PAM support: no` in this environment, so this was a compile check for the relevant monitor/log/PAM source files, not a runtime PAM reproduction.

Bounded independent reproduction attempt:
`./sshd-session -h`
Result: blocked because `./sshd-session` was not built in the workspace (`No such file or directory`). A realistic invalid-login runtime reproduction was also blocked by the failed root build entrypoint and the fallback configuration lacking PAM headers/support, so confidence remains `inferred`.

## Review Pass 1

RESULT: ok

No source changes are present, and `## Git Add Paths` correctly says `None`. The author kept confidence at `inferred`, did not invent a reproducer, and connected the profiler/strace evidence to the existing OpenSSH preauth monitor/logging path without overstating it as a confirmed bug.

Validation is acceptable for a no-patch diagnosis: `./configure && make` was attempted from the workspace root and failed with the exact generated-file blocker, then a focused compile was run in a temporary regenerated copy. The report also names the relevant local helpers and conventions (`sshbuf`, `atomicio`, `sshlogdirect`, `mm_log_handler`, `fatal_f`/`fatal_fr`) and explains why no upstreamable source patch should be landed from the current evidence.

diagnosis-only report

report

sshd-session likely remains stuck in a socket churn loop. A diagnosis report and patch proposal were created locally.

state: readycreated: 2026-05-13 11:41 UTCvalidation: ready
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. The latest author response is at `./patch-output.txt`. Inspect the current code and changed paths like a strict code reviewer. Focus on correctness, regressions, maintainability, awkward control flow such as avoidable `goto`, missing validation, weak or non-gittable commit message text, and explanations that fail to connect the observed issue evidence to the code change. Also review the maintainer experience: the patch mail should be easy to accept upstream, the user-visible bug should be explained in plain language, subsystem-specific jargon should be defined when first used, and any non-obvious state translation or index remapping in code should have a short explanatory comment. Reject patches that omit `## Evidence Confidence`, use anything other than `reproduced`, `observed`, or `inferred`, or sound more certain than that evidence level allows. Reject patches that claim `reproduced` unless `## Validation` names the concrete reproduction command or test and its result. Reject patches that invent a reproducer, command line, crash, or user-visible failure not present in the evidence bundle; indirect profiler or strace evidence may justify a cautious mitigation, but the author must say it is indirect instead of presenting it as a confirmed upstream bug. Reject patches that introduce generic libc/std APIs when nearby code or project docs provide a local compat/helper API for the same job, unless the author explicitly justifies the exception. Reject validation that only reports a leaf object/syntax build when a project-level configure/build/test entrypoint exists and was not attempted; if a full build cannot run, the author must show the exact failed command and blocker.

Do not apply code changes in this pass.

Return a short markdown review report. The first non-empty line must be exactly one of:

RESULT: ok
RESULT: fix-needed

If you choose `RESULT: fix-needed`, add a `## Findings` section with concrete, actionable items.

Response

## Plan Pass

## Problem
The bundle reports `sshd-session` as “runaway/socket-churn”, but the available signal shows a sleeping preauth monitor in `poll`, total CPU around `0.2%`, and a normal invalid-login teardown with syslog/PAM messages followed by `munmap`. The raw investigation files referenced by `evidence.json` are not present, so the strace excerpt is the only primary trace available.

## Evidence Confidence
inferred

## Proposed Subject
No source patch yet: diagnose likely false-positive/insufficient evidence for an OpenSSH upstream change.

## Patch Plan
I would not edit OpenSSH from this evidence alone. A patch that changes syslog lifetime, PAM cleanup, or monitor log draining would be speculative because the trace does not show a busy loop, retry loop, or sustained socket churn in OpenSSH code.

Before any edit, collect one bounded extra signal: run a local loopback invalid-login attempt against a temporary `sshd-session`/`sshd` test config under `strace -f -tt -e poll,read,write,sendto,socket,connect,close,munmap,wait4` and verify whether the same process repeatedly cycles without exit or just performs normal preauth cleanup. Only if that shows repeated OpenSSH-controlled logging/monitor churn would I plan a targeted patch.

No prior Fixer patch is present in the workspace (`git diff` is empty), so there is nothing to replace or improve.

Maintainer conventions found: OpenSSH uses `sshbuf`, `atomicio`, `fatal_f`/`fatal_fr`, `debug_f`, `cleanup_exit`, `FD_CLOSEONEXEC`, and monitor log forwarding via `mm_log_handler`/`monitor_read_log`. Any future patch should follow those helpers and avoid awkward control flow such as avoidable `goto`.

## Risks
Changing syslog open/close behavior may affect chroot/reexec/facility handling; `log_init()` explicitly forces an open/close to avoid stale syslog state after reexec. Changing PAM cleanup or max-tries handling risks authentication regressions. Without stronger evidence, the safest upstream-quality result is a diagnosis rather than a source change.

## Validation
First try the project-level entrypoint from the workspace root: `./configure && make`.

If dependencies or generated files are missing, record the exact failure and then run the narrowest relevant compile, likely for `log.o`, `monitor.o`, `monitor_wrap.o`, `auth.o`, `auth2.o`, and `auth-pam.o` after configuration.

Independent reproduction attempt before claiming any fix: run a bounded local invalid-login/preauth teardown under `strace` and confirm whether it demonstrates an actual repeated loop. I would not claim `reproduced` unless that command shows sustained repeated syscalls rather than one normal failed-auth cleanup.

## Patch Pass

Subject: no patch: sshd-session trace lacks OpenSSH loop evidence

## Commit Message
No source change. The collected perf, strace, and `/proc` evidence points to a normal failed pre-authentication teardown, not to a confirmed OpenSSH busy loop. The sampled privileged `sshd-session` process was sleeping in `poll`, showed only `0.2%` total CPU, logged an invalid-user disconnect and PAM cleanup messages, then unmapped libraries during exit.

## Evidence Confidence
inferred

## Issue Connection
The collected signal was a profiler/strace report classifying `sshd-session` as likely socket churn. In the available excerpt, however, the process state is `S (sleeping)`, the kernel stack is blocked in `poll_schedule_timeout`, and the strace shows a bounded sequence: read a child log message, send syslog messages via `/dev/log`, observe child hangup, wait for the child, then run teardown `munmap` calls.

The cautious code-level inference is that Fixer sampled the privileged preauth monitor, meaning the process supervising an unauthenticated child before login completes, during ordinary invalid-login cleanup. The evidence does not show an OpenSSH-controlled retry loop, sustained socket churn, or a user-visible failure that an upstream source patch can safely target.

I followed the saved plan and did not change course: no source diff was left. Nearby code already uses OpenSSH helpers and conventions for this path, including `sshbuf`, `atomicio`, `fatal_f`/`fatal_fr`, `debug_f`, `cleanup_exit`, `FD_CLOSEONEXEC`, and monitor log forwarding through `mm_log_handler` and `monitor_read_log`. `README.md` was the only contribution/style document found from the requested set; no `CONTRIBUTING`, `HACKING`, `README-hacking`, `docs/`, or `dev-docs/` guidance was present.

The expected effect is no behavioral change: this is a no-patch diagnosis suitable for an upstream bug report unless stronger evidence shows repeated OpenSSH-side churn.

## Git Add Paths
None

## Validation
Tried project-level entrypoint from the workspace root:

`./configure && make`

It failed before configuration with:

`configure: error: ./configure.ac newer than configure, run autoreconf`

Tried a focused leaf compile probe without regenerating autotools files:

`cc -fsyntax-only -I. monitor.c`

It failed because the clean snapshot has no configured header:

`includes.h:19:10: fatal error: config.h: No such file or directory`

Tried a bounded independent reproduction with installed `sshd` under `strace` and a loopback invalid-user `ssh` connection. It was blocked by sandbox permissions: `strace` reported `PTRACE_TRACEME: Operation not permitted` and `ptrace(PTRACE_SEIZE, 11): Operation not permitted`; the client also failed with `socket: Operation not permitted`.

The raw strace path named in `evidence.json` was not present in this container. `git status --short` is clean.

## Review Pass 1

RESULT: ok

No source changes were left in the workspace, and that matches the evidence level. The author correctly classified the evidence as `inferred`, avoided a speculative OpenSSH patch, explained the likely preauth monitor teardown path, named local OpenSSH helper conventions, and reported the project-level validation failure before the focused compile probe.

Validation reporting is adequate for a no-patch diagnosis: `./configure && make` was attempted and failed with the exact autoreconf blocker, the leaf compile failed due missing `config.h`, and the bounded reproduction attempt was blocked by ptrace/socket sandbox permissions rather than claimed as reproduced.

diagnosis-only report

report

sshd-session likely remains stuck in a socket churn loop. A diagnosis report and patch proposal were created locally.

state: readycreated: 2026-05-13 11:41 UTCvalidation: ready
Published session

Prompt

## Plan Pass

You are planning a fixer patch before any edits happen.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. The original pre-edit snapshot is available at `./source` if you need to inspect it. For interpreter processes, plan from the script/application entrypoint evidence first and include the runtime only as a second investigation target unless the evidence proves a runtime bug.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. Inspect the relevant code, nearby callers, project contribution docs, and local helper/compat APIs, but do not edit files in this pass.

Return a short markdown plan with these exact sections:

## Problem
## Evidence Confidence
## Proposed Subject
## Patch Plan
## Risks
## Validation

Classify `## Evidence Confidence` as exactly one of `reproduced`, `observed`, or `inferred`. Use `inferred` only for a no-patch diagnosis/report plan unless you can name the extra evidence you will collect before editing; inferred source patches are blocked by Fixer because they are not pull-request-ready. For `observed` source-patch plans, plan to say in the final `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. The plan must explain how the proposed code change addresses the observed issue evidence, call out any prior Fixer patch that should be improved or replaced, reject awkward control flow such as avoidable `goto` if there is a cleaner bounded alternative, name any local helper APIs or maintainer conventions the patch should follow, and keep the intended maintainer-facing explanation clear enough that someone unfamiliar with the local complaint wording can still follow the fix. In `## Validation`, name the reproducible configure/build/test entrypoint you will try from the workspace root before any focused leaf compile or smoke check, and include one bounded independent reproduction attempt for the collected failure signal when it is safe and cheap. Do not plan to claim `reproduced` unless that reproduction command or test can actually show the failure.

## Patch Pass

You are working on a bounded fixer proposal.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Produce the smallest reasonable patch for the target repository, keep the change upstreamable, prefer the clearest control flow available, and do not keep avoidable `goto` when a simpler structure would read better. Before introducing new file, process, allocation, locking, networking, or platform APIs, inspect nearby code and project contribution docs for existing helpers or compatibility wrappers and use those local patterns unless you can explain why they do not fit. Validate from a reproducible workspace-root entrypoint before falling back to focused leaf commands; if a build or test cannot run, report the exact command, the exact blocker, and any narrower check you ran instead. During validation, also try one bounded independent reproduction of the collected failure signal when it is safe and cheap, such as a failing test, smoke command, perf/strace comparison, or before/after runtime check. Only use `reproduced` if that command or test actually reproduced the failure; otherwise keep `observed` and report the reproduction blocker. The final explanation must connect the observed issue evidence to the actual code change, not just paraphrase the diff. Write like a maintainer is going to read the patch mail cold: explain the bug in plain language, define subsystem-specific jargon the first time you need it, and make the causal story obvious. Explicitly classify evidence confidence as `reproduced`, `observed`, or `inferred`: `reproduced` means you reproduced the failure locally; `observed` means Fixer has direct crash/log/trace evidence but you did not independently reproduce it; `inferred` means the source patch is not pull-request-ready, so do not leave a source diff unless you first gather stronger observed/reproduced evidence; otherwise return a no-patch diagnosis/report. For any source-changing `observed` patch, say explicitly in `## Issue Connection` that the failure was observed by Fixer and not independently reproduced. If you introduce non-obvious state translation, index remapping, or backend split logic, add a short source comment that explains the invariant being preserved.

Start by explaining the likely root cause from the collected perf, strace, and /proc evidence. If you cannot land a safe patch, leave a diagnosis that is strong enough for an upstream bug report.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround. 

Keep the change narrowly scoped and summarize validation clearly.

In every authoring pass, your final response must start with `Subject: <single-line git commit subject>` and then include these markdown sections exactly:

## Commit Message
A short upstream-friendly explanation of what changed and why. Write it in plain language that a maintainer can follow without local complaint context. If you use subsystem jargon, define it immediately.

## Evidence Confidence
Exactly one word: `reproduced`, `observed`, or `inferred`. Use `reproduced` only when you reproduced the failure locally with a command or test, and include that command/test in `## Validation`. Use `observed` when Fixer has direct crash/log/trace evidence but you did not independently reproduce it. If `## Git Add Paths` lists source files for an `observed` patch, `## Issue Connection` must explicitly say the failure was observed by Fixer and not independently reproduced. Use `inferred` for profiler/strace/indirect evidence; inferred responses may be no-patch diagnoses or reports, but inferred source patches are not pull-request-ready until stronger evidence is gathered.

## Issue Connection
Write this as maintainer-facing patch mail, not as local Fixer notes. Cover four things explicitly in readable sentences: the user-visible symptom or the exact collected signal, the code-level cause or the cautious inference from evidence, the specific change you made, and the expected effect. Do not invent a reproducer, command line, crash, or user-visible failure that is not present in the evidence bundle. If the evidence is direct-but-not-reproduced, say it was observed by Fixer and not independently reproduced. If the evidence is indirect and you did not gather stronger evidence, do not leave a source diff; write a no-patch diagnosis/report instead. Include an explicit effect sentence such as `The expected effect is ...`, `This should reduce ...`, or `This prevents ...` for source patches. If the logic is non-obvious in code, mention that you added a short explanatory comment.

## Git Add Paths
List the repo-relative paths that belong in the final patch, one per line. Use `None` only when you intentionally made no source changes. Include intentionally new files, and do not list generated build artifacts.

## Validation
List the checks you ran, or say clearly that you could not run them. Include the independent reproduction command/test and result when `## Evidence Confidence` is `reproduced`; if reproduction was attempted but blocked, name the exact blocker and keep confidence at `observed` or `inferred`.

Before editing, read the plan at `./plan-output.txt` and follow it unless the code proves part of it wrong. If you change course, say so explicitly in the final write-up instead of silently drifting from the plan.

## Review Pass 1

You are reviewing a freshly generated fixer patch.

Read the evidence bundle at `./evidence.json`. The prepared workspace is `./workspace` and it was acquired via `debian-source`. Review the first patch pass. The original pre-edit snapshot is available at `./source` for diffing.

Upstream-style expectation: before planning or editing, check for contribution/style docs (`CONTRIBUTING`, `HACKING`, `README-hacking`, `README.md`, `docs/`, `dev-docs/`) and scan the touched subsystem for local helpers. If the project has wrappers for file IO, path-relative IO, process spawning, memory allocation, logging, locking, or platform compatibility, prefer those wrappers over generic libc/std APIs. Do not invent a reproducer or user-visible failure that is not in the evidence bundle; if the evidence is profiler-only or indirect, describe it as a targeted mitigation or stop with a diagnosis instead of presenting a speculative patch as a confirmed bug fix. In the plan and final validation, name any such helper, convention, or evidence limit you found, or say that no relevant local helper was found. Treat this as a `openssh` upstream patch, not just a Debian-local workaround.

Validation expectation: try the project-level build/test entrypoint from the workspace root before reporting only a focused leaf compile. Detected candidate(s): `./configure && make`. If the project-level command fails because dependencies or generated files are missing, include the exact command and failure reason in `## Validation`, then run the narrowest relevant compile/test that is still reproducible from a clean checkout. The latest author response is at `./patch-output.txt`. Inspect the current code and changed paths like a strict code reviewer. Focus on correctness, regressions, maintainability, awkward control flow such as avoidable `goto`, missing validation, weak or non-gittable commit message text, and explanations that fail to connect the observed issue evidence to the code change. Also review the maintainer experience: the patch mail should be easy to accept upstream, the user-visible bug should be explained in plain language, subsystem-specific jargon should be defined when first used, and any non-obvious state translation or index remapping in code should have a short explanatory comment. Reject patches that omit `## Evidence Confidence`, use anything other than `reproduced`, `observed`, or `inferred`, or sound more certain than that evidence level allows. Reject patches that claim `reproduced` unless `## Validation` names the concrete reproduction command or test and its result. Reject patches that invent a reproducer, command line, crash, or user-visible failure not present in the evidence bundle; indirect profiler or strace evidence may justify a cautious mitigation, but the author must say it is indirect instead of presenting it as a confirmed upstream bug. Reject patches that introduce generic libc/std APIs when nearby code or project docs provide a local compat/helper API for the same job, unless the author explicitly justifies the exception. Reject validation that only reports a leaf object/syntax build when a project-level configure/build/test entrypoint exists and was not attempted; if a full build cannot run, the author must show the exact failed command and blocker.

Do not apply code changes in this pass.

Return a short markdown review report. The first non-empty line must be exactly one of:

RESULT: ok
RESULT: fix-needed

If you choose `RESULT: fix-needed`, add a `## Findings` section with concrete, actionable items.

Response

## Plan Pass

## Problem
The bundle reports `sshd-session` as “runaway/socket-churn”, but the available signal shows a sleeping preauth monitor in `poll`, total CPU around `0.2%`, and a normal invalid-login teardown with syslog/PAM messages followed by `munmap`. The raw investigation files referenced by `evidence.json` are not present, so the strace excerpt is the only primary trace available.

## Evidence Confidence
inferred

## Proposed Subject
No source patch yet: diagnose likely false-positive/insufficient evidence for an OpenSSH upstream change.

## Patch Plan
I would not edit OpenSSH from this evidence alone. A patch that changes syslog lifetime, PAM cleanup, or monitor log draining would be speculative because the trace does not show a busy loop, retry loop, or sustained socket churn in OpenSSH code.

Before any edit, collect one bounded extra signal: run a local loopback invalid-login attempt against a temporary `sshd-session`/`sshd` test config under `strace -f -tt -e poll,read,write,sendto,socket,connect,close,munmap,wait4` and verify whether the same process repeatedly cycles without exit or just performs normal preauth cleanup. Only if that shows repeated OpenSSH-controlled logging/monitor churn would I plan a targeted patch.

No prior Fixer patch is present in the workspace (`git diff` is empty), so there is nothing to replace or improve.

Maintainer conventions found: OpenSSH uses `sshbuf`, `atomicio`, `fatal_f`/`fatal_fr`, `debug_f`, `cleanup_exit`, `FD_CLOSEONEXEC`, and monitor log forwarding via `mm_log_handler`/`monitor_read_log`. Any future patch should follow those helpers and avoid awkward control flow such as avoidable `goto`.

## Risks
Changing syslog open/close behavior may affect chroot/reexec/facility handling; `log_init()` explicitly forces an open/close to avoid stale syslog state after reexec. Changing PAM cleanup or max-tries handling risks authentication regressions. Without stronger evidence, the safest upstream-quality result is a diagnosis rather than a source change.

## Validation
First try the project-level entrypoint from the workspace root: `./configure && make`.

If dependencies or generated files are missing, record the exact failure and then run the narrowest relevant compile, likely for `log.o`, `monitor.o`, `monitor_wrap.o`, `auth.o`, `auth2.o`, and `auth-pam.o` after configuration.

Independent reproduction attempt before claiming any fix: run a bounded local invalid-login/preauth teardown under `strace` and confirm whether it demonstrates an actual repeated loop. I would not claim `reproduced` unless that command shows sustained repeated syscalls rather than one normal failed-auth cleanup.

## Patch Pass

Subject: no patch: sshd-session trace lacks OpenSSH loop evidence

## Commit Message
No source change. The collected perf, strace, and `/proc` evidence points to a normal failed pre-authentication teardown, not to a confirmed OpenSSH busy loop. The sampled privileged `sshd-session` process was sleeping in `poll`, showed only `0.2%` total CPU, logged an invalid-user disconnect and PAM cleanup messages, then unmapped libraries during exit.

## Evidence Confidence
inferred

## Issue Connection
The collected signal was a profiler/strace report classifying `sshd-session` as likely socket churn. In the available excerpt, however, the process state is `S (sleeping)`, the kernel stack is blocked in `poll_schedule_timeout`, and the strace shows a bounded sequence: read a child log message, send syslog messages via `/dev/log`, observe child hangup, wait for the child, then run teardown `munmap` calls.

The cautious code-level inference is that Fixer sampled the privileged preauth monitor, meaning the process supervising an unauthenticated child before login completes, during ordinary invalid-login cleanup. The evidence does not show an OpenSSH-controlled retry loop, sustained socket churn, or a user-visible failure that an upstream source patch can safely target.

I followed the saved plan and did not change course: no source diff was left. Nearby code already uses OpenSSH helpers and conventions for this path, including `sshbuf`, `atomicio`, `fatal_f`/`fatal_fr`, `debug_f`, `cleanup_exit`, `FD_CLOSEONEXEC`, and monitor log forwarding through `mm_log_handler` and `monitor_read_log`. `README.md` was the only contribution/style document found from the requested set; no `CONTRIBUTING`, `HACKING`, `README-hacking`, `docs/`, or `dev-docs/` guidance was present.

The expected effect is no behavioral change: this is a no-patch diagnosis suitable for an upstream bug report unless stronger evidence shows repeated OpenSSH-side churn.

## Git Add Paths
None

## Validation
Tried project-level entrypoint from the workspace root:

`./configure && make`

It failed before configuration with:

`configure: error: ./configure.ac newer than configure, run autoreconf`

Tried a focused leaf compile probe without regenerating autotools files:

`cc -fsyntax-only -I. monitor.c`

It failed because the clean snapshot has no configured header:

`includes.h:19:10: fatal error: config.h: No such file or directory`

Tried a bounded independent reproduction with installed `sshd` under `strace` and a loopback invalid-user `ssh` connection. It was blocked by sandbox permissions: `strace` reported `PTRACE_TRACEME: Operation not permitted` and `ptrace(PTRACE_SEIZE, 11): Operation not permitted`; the client also failed with `socket: Operation not permitted`.

The raw strace path named in `evidence.json` was not present in this container. `git status --short` is clean.

## Review Pass 1

RESULT: ok

No source changes were left in the workspace, and that matches the evidence level. The author correctly classified the evidence as `inferred`, avoided a speculative OpenSSH patch, explained the likely preauth monitor teardown path, named local OpenSSH helper conventions, and reported the project-level validation failure before the focused compile probe.

Validation reporting is adequate for a no-patch diagnosis: `./configure && make` was attempted and failed with the exact autoreconf blocker, the leaf compile failed due missing `config.h`, and the bounded reproduction attempt was blocked by ptrace/socket sandbox permissions rather than claimed as reproduced.