[PATCH] protocol: disable connection reuse for SMB(S)
authorDaniel Stenberg <daniel@haxx.se>
Sun, 5 Apr 2026 16:23:35 +0000 (18:23 +0200)
committerSamuel Henrique <samueloph@debian.org>
Fri, 8 May 2026 14:16:21 +0000 (07:16 -0700)
commit0ce9fd8249b4c87c7be1975a0849aefff08c0225
treedeec7e14848049a5966358c08165299231a8ca9e
parent2daf5a6df57d880c4f0a59e147cf9de77ab4bb9d
[PATCH] protocol: disable connection reuse for SMB(S)

Connections should only be reused when using the same "share" (and
perhaps some additional conditions), but instead of fixing this flaw,
this change completely disables connection reuse for SMB. This protocol
is about to get dropped soon anyway.

Reported-by: Osama Hamad
Closes #21238

Backported-by: Samuel Henrique <samueloph@debian.org>
 * Upstream removes PROTOPT_CONN_REUSE from the SMB and SMBS scheme
   registrations in lib/protocol.c. That flag (and the lib/protocol.c scheme
   registry itself) only exists from upstream commit
   feea96851230c7a5a11feaffa0a5e4a4d30e5e63 ("conncontrol: reuse handling", Nov
   2025) onward, so neither is present in 8.14.1. In 8.14.1 SMB connection
   reuse is instead controlled at runtime via connkeep() / connclose(), and
   lib/smb.c explicitly calls connkeep() in smb_connect() to mark SMB
   connections as eligible for reuse. Replace that connkeep() with a
   connclose() so SMB connections are marked as not-reusable, achieving the
   same effect as the upstream change.

Backported by: Samuel Henrique <samueloph@debian.org>
 * Bookworm 7.88.1: same connkeep() call in smb_connect() at line
   271. Apply the same connkeep() -> connclose() swap; this version
   also lacks PROTOPT_CONN_REUSE so the runtime approach is the
   only way to express "do not reuse this connection".

Gbp-Pq: Name CVE-2026-5773.patch
lib/smb.c