From: Suyuan Wang via B4 Relay <devnull+shyckless.gmail.com@kernel.org>
To: linkinjeon@kernel.org, pc@manguebit.org
Cc: ematsumiya@suse.de, sprasad@microsoft.com,
linux-cifs@vger.kernel.org, bharathsm@microsoft.com,
ronniesahlberg@gmail.com, samba-technical@lists.samba.org,
daniel.birtwhistle@gehealthcare.com,
linux-kernel@vger.kernel.org, smfrench@gmail.com,
dhowells@redhat.com, tom@talpey.com
Subject: [PATCH v2 0/2] smb: client: don't use SMB2 responses that fail signature verification
Date: Mon, 16 Nov 2026 04:06:22 +0000 [thread overview]
Message-ID: <20261116-smb2-sign-v2-0-a823a90d0db4@gmail.com> (raw)
v1 made smb2_check_receive() return the error when a response signature
doesn't verify. Sashiko pointed out that this isn't enough:
compound_send_recv() still passes the response buffer to the caller, and
smb2_compound_op() parses it anyway. It also found that
smb2_readv_callback() can drop the error when the read reaches EOF.
Patch 1 is v1 plus not passing the response on in compound_send_recv().
Patch 2 fixes the read path.
I tested this in QEMU (x86_64, next-20261109, PROVE_LOCKING on) against
Samba 4.15 with "server signing = mandatory", through a proxy that
changes responses without fixing the signature:
- EndOfFile in the QUERY_INFO response of the open/query/close compound
(stat): with v1 the forged size is copied into the open info, and stat
only shows the right size because the caller takes -EACCES for
STATUS_ACCESS_DENIED and opens the file again. With v2 stat fails with
EACCES.
- READ data, cache=none: without patch 2, cat prints the modified data.
With it, the read fails with EACCES.
- A file name in QUERY_DIRECTORY (the v1 test): still EACCES, and the
handle from the CREATE in that compound is closed ("Close unmatched
open").
- Without the proxy, stat, read, write, ls and rm work as before.
Enzo's point about SMB 3.1.1 tree connect responses is not covered here,
that can be a follow-up.
Changes in v2:
- Patch 1: also don't hand the response to the caller in
compound_send_recv() (Sashiko)
- Patch 2: new
- v1: https://lore.kernel.org/all/20261113-smb2-sign-v1-1-937ee7c20f08@gmail.com/
---
Suyuan Wang (2):
smb: client: fail SMB2 responses with a bad signature
smb: client: don't use read data that failed signature verification
fs/smb/client/smb2pdu.c | 2 ++
fs/smb/client/smb2transport.c | 6 +++++-
fs/smb/client/transport.c | 6 ++++++
3 files changed, 13 insertions(+), 1 deletion(-)
next reply other threads:[~2026-11-16 4:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 4:06 Suyuan Wang via B4 Relay [this message]
2026-11-16 4:06 ` [PATCH v2 1/2] smb: client: fail SMB2 responses with a bad signature Suyuan Wang via B4 Relay
2026-11-16 4:06 ` [PATCH v2 2/2] smb: client: don't use read data that failed signature verification Suyuan Wang via B4 Relay
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=20261116-smb2-sign-v2-0-a823a90d0db4@gmail.com \
--to=devnull+shyckless.gmail.com@kernel.org \
--cc=bharathsm@microsoft.com \
--cc=daniel.birtwhistle@gehealthcare.com \
--cc=dhowells@redhat.com \
--cc=ematsumiya@suse.de \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pc@manguebit.org \
--cc=ronniesahlberg@gmail.com \
--cc=samba-technical@lists.samba.org \
--cc=shyckless@gmail.com \
--cc=smfrench@gmail.com \
--cc=sprasad@microsoft.com \
--cc=tom@talpey.com \
/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
all inboxes | Powered by JetHome®