From nobody Wed Feb 11 12:08:03 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 903F517B501; Wed, 27 Mar 2024 12:24:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711542261; cv=none; b=gHd6WDkNMzruOVcu1AQP+w1QEfmg8dx790V+6TCL5CIYcmNNSDnCljBx3W9T8ENx6gwDNGrX/WelFLw+B7nIWBby4mYxPSsok7U0Yavd/f5JFJL+Ory3qqmYx0FjeaLnbBHDrC/mvh4inQzLNurQuQGp3oM7v4a+JmrQj1jgkmA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711542261; c=relaxed/simple; bh=TFwScC8lPWBvLGeSG1RgGYulOSwTyzn+0lEOPbziDOs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Vzq/35eppR6GdAMXVA9aaiGGYNIqwIXFzqbf6HDT4oJrr+Qxdc8TGnmpCcic28TblQimzv9pPF2e822U/GeLGBXCkCLDKLxnMYrSQk62XdS/QgZBQbeJWUl+VyKiQWTUzM0sKAIFidx5mS/iRP9Jm7gv4dRigOb0ENZtkjGhfZE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=U6YtDHo/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="U6YtDHo/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F98DC433F1; Wed, 27 Mar 2024 12:24:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711542261; bh=TFwScC8lPWBvLGeSG1RgGYulOSwTyzn+0lEOPbziDOs=; h=From:To:Cc:Subject:Date:From; b=U6YtDHo/dK1LzZbvbY84JcWIU95y51JzTR53emC+xdbhI2akQcn6r7MrPvPCOhmc5 X560KPfMUyTqo4z9kMOGr1L6RsyuMgM55eOro+s9qndEUyVr6QZlEfIBQ1kgURXy+M pZhDCGyNynu5lNAVVJUzdzBj+46IW6x1CblVPLsMXZGdCwtgHSGBpYNXFErONKcJF9 UPX1GnS+gEFvwZf6GlGWWiG3+jzbm+4ERSAf7bhdqWSUQsomTUqHkM+bP9zUBI3EIS G70nI+wTUDgcLgAxmaCWGCj3hW9RVoLC8Xsx0JJGvwQBkzSFEfFISxbs2ZhV7Ukr9+ U8jO9Or4iz2uA== From: Sasha Levin To: stable@vger.kernel.org, sprasad@microsoft.com Cc: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= , Paulo Alcantara , Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Subject: FAILED: Patch "cifs: make sure server interfaces are requested only for SMB3+" failed to apply to 5.4-stable tree Date: Wed, 27 Mar 2024 08:24:18 -0400 Message-ID: <20240327122419.2839315-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha Reported-by: Paulo Alcantara ------------------ original commit in Linus's tree ------------------ From 13c0a74747cb7fdadf58c5d3a7d52cfca2d51736 Mon Sep 17 00:00:00 2001 From: Shyam Prasad N Date: Wed, 13 Mar 2024 10:40:41 +0000 Subject: [PATCH] cifs: make sure server interfaces are requested only for SMB3+ MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Some code paths for querying server interfaces make a false assumption that it will only get called for SMB3+. Since this function now can get called from a generic code paths, the correct thing to do is to have specific handler for this functionality per SMB dialect, and call this handler. This change adds such a handler and implements this handler only for SMB 3.0 and 3.1.1. Cc: stable@vger.kernel.org Cc: Jan =C4=8Cerm=C3=A1k Reported-by: Paulo Alcantara Signed-off-by: Shyam Prasad N Signed-off-by: Steve French --- fs/smb/client/cifsglob.h | 3 +++ fs/smb/client/connect.c | 6 +++++- fs/smb/client/smb2ops.c | 2 ++ fs/smb/client/smb2pdu.c | 5 +++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index 8be62ed053a25..3da625d532359 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -355,6 +355,9 @@ struct smb_version_operations { /* informational QFS call */ void (*qfs_tcon)(const unsigned int, struct cifs_tcon *, struct cifs_sb_info *); + /* query for server interfaces */ + int (*query_server_interfaces)(const unsigned int, struct cifs_tcon *, + bool); /* check if a path is accessible or not */ int (*is_path_accessible)(const unsigned int, struct cifs_tcon *, struct cifs_sb_info *, const char *); diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 86ae578904a26..4cbb79418e506 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -123,12 +123,16 @@ static void smb2_query_server_interfaces(struct work_= struct *work) struct cifs_tcon *tcon =3D container_of(work, struct cifs_tcon, query_interfaces.work); + struct TCP_Server_Info *server =3D tcon->ses->server; =20 /* * query server network interfaces, in case they change */ + if (!server->ops->query_server_interfaces) + return; + xid =3D get_xid(); - rc =3D SMB3_request_interfaces(xid, tcon, false); + rc =3D server->ops->query_server_interfaces(xid, tcon, false); free_xid(xid); =20 if (rc) { diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 6ee22d0dbc006..2ed456948f34c 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -5290,6 +5290,7 @@ struct smb_version_operations smb30_operations =3D { .tree_connect =3D SMB2_tcon, .tree_disconnect =3D SMB2_tdis, .qfs_tcon =3D smb3_qfs_tcon, + .query_server_interfaces =3D SMB3_request_interfaces, .is_path_accessible =3D smb2_is_path_accessible, .can_echo =3D smb2_can_echo, .echo =3D SMB2_echo, @@ -5405,6 +5406,7 @@ struct smb_version_operations smb311_operations =3D { .tree_connect =3D SMB2_tcon, .tree_disconnect =3D SMB2_tdis, .qfs_tcon =3D smb3_qfs_tcon, + .query_server_interfaces =3D SMB3_request_interfaces, .is_path_accessible =3D smb2_is_path_accessible, .can_echo =3D smb2_can_echo, .echo =3D SMB2_echo, diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index e5e6b14f8cae3..3ea688558e6c9 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -409,14 +409,15 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon = *tcon, spin_unlock(&ses->ses_lock); =20 if (!rc && - (server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) { + (server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL) && + server->ops->query_server_interfaces) { mutex_unlock(&ses->session_mutex); =20 /* * query server network interfaces, in case they change */ xid =3D get_xid(); - rc =3D SMB3_request_interfaces(xid, tcon, false); + rc =3D server->ops->query_server_interfaces(xid, tcon, false); free_xid(xid); =20 if (rc =3D=3D -EOPNOTSUPP && ses->chan_count > 1) { --=20 2.43.0