public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: "Dr. Thomas Orgis" <thomas.orgis@uni-hamburg.de>
To: Henrique Carvalho <henrique.carvalho@suse.com>
Cc: Steve French <sfrench@samba.org>, <linux-cifs@vger.kernel.org>,
	<regressions@lists.linux.dev>, <stable@vger.kernel.org>
Subject: Re: [REGRESSION] failure to reconnect on SMB server restart with custom TCP port (not 445): Host is down (at least since 6.6.95)
Date: Wed, 11 Mar 2026 09:16:53 +0100	[thread overview]
Message-ID: <20260311091653.358b213a@plasteblaster> (raw)
In-Reply-To: <c66p7dr6vlujvnwczbnrmqx7monkdgdnm4rwewm76aibn7jza3@d3uik74dei72>

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

Am Tue, 10 Mar 2026 23:06:24 -0300
schrieb Henrique Carvalho <henrique.carvalho@suse.com>:

> My suspicion is that the regression was introduced by:
> 
>     5713127da855 ("cifs: update dstaddr whenever channel iface is updated")
> 
> That change causes parse_server_interfaces() -- should this be running
> without multichannel mount option? -- to overwrite the port stored in
> server->dstaddr with CIFS_PORT.
> 
> The attached patch preserves the existing port from server->dstaddr.

Splendit! This is the simple something that would've taken me long to
find among all the ongoing changes in the SMB subsystem.

I just built a 6.6.129 kernel with the slightly adapted patch (as that
is my production series right now before I jump to newer LTS) and can
confirm that this fixes the issue.

Do you need a confirmation with 7.0.0-rc3? I guess the picture is clear
enough as-is. I've started a build and can give a short follow-up later.


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg

[-- Attachment #2: smb-nonstandard-port-fix-6.6.patch --]
[-- Type: text/x-patch, Size: 1496 bytes --]

--- linux-6.6.129/fs/smb/client/smb2ops.c.orig	2026-03-05 16:03:43.000000000 +0100
+++ linux-6.6.129/fs/smb/client/smb2ops.c	2026-03-11 08:25:05.244722103 +0100
@@ -586,6 +586,7 @@
 	struct iface_info_ipv6 *p6;
 	struct cifs_server_iface *info = NULL, *iface = NULL, *niface = NULL;
 	struct cifs_server_iface tmp_iface;
+	__be16 port;
 	ssize_t bytes_left;
 	size_t next = 0;
 	int nb_iface = 0;
@@ -634,18 +635,20 @@
 		 * conversion explicit in case either one changes.
 		 */
 		case INTERNETWORK:
+			port = ((struct sockaddr_in *)&ses->server->dstaddr)->sin_port;
 			addr4 = (struct sockaddr_in *)&tmp_iface.sockaddr;
 			p4 = (struct iface_info_ipv4 *)p->Buffer;
 			addr4->sin_family = AF_INET;
 			memcpy(&addr4->sin_addr, &p4->IPv4Address, 4);
 
 			/* [MS-SMB2] 2.2.32.5.1.1 Clients MUST ignore these */
-			addr4->sin_port = cpu_to_be16(CIFS_PORT);
+			addr4->sin_port = port;
 
 			cifs_dbg(FYI, "%s: ipv4 %pI4\n", __func__,
 				 &addr4->sin_addr);
 			break;
 		case INTERNETWORKV6:
+			port = ((struct sockaddr_in6 *)&ses->server->dstaddr)->sin6_port;
 			addr6 =	(struct sockaddr_in6 *)&tmp_iface.sockaddr;
 			p6 = (struct iface_info_ipv6 *)p->Buffer;
 			addr6->sin6_family = AF_INET6;
@@ -654,7 +657,7 @@
 			/* [MS-SMB2] 2.2.32.5.1.2 Clients MUST ignore these */
 			addr6->sin6_flowinfo = 0;
 			addr6->sin6_scope_id = 0;
-			addr6->sin6_port = cpu_to_be16(CIFS_PORT);
+			addr6->sin6_port = port;
 
 			cifs_dbg(FYI, "%s: ipv6 %pI6\n", __func__,
 				 &addr6->sin6_addr);

  reply	other threads:[~2026-03-11  8:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 22:56 [REGRESSION] failure to reconnect on SMB server restart with custom TCP port (not 445): Host is down (at least since 6.6.95) Dr. Thomas Orgis
2026-03-11  2:06 ` Henrique Carvalho
2026-03-11  8:16   ` Dr. Thomas Orgis [this message]
2026-03-11  8:48     ` Dr. Thomas Orgis
2026-03-11 16:12       ` Henrique Carvalho
2026-03-11 16:21         ` Dr. Thomas Orgis
2026-03-12  0:14   ` Shyam Prasad N
2026-03-12 15:03     ` Henrique Carvalho
2026-03-12 15:40       ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260311091653.358b213a@plasteblaster \
    --to=thomas.orgis@uni-hamburg.de \
    --cc=henrique.carvalho@suse.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=sfrench@samba.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox