From: Paulo Alcantara <pc@manguebit.org>
To: shyckless@gmail.com, linkinjeon@kernel.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: Re: [PATCH v2 1/2] smb: client: fail SMB2 responses with a bad signature
Date: Wed, 18 Nov 2026 19:02:39 -0300 [thread overview]
Message-ID: <696b8c3e063478965da1084ffae1d6cf@manguebit.org> (raw)
In-Reply-To: <20261116-smb2-sign-v2-1-a823a90d0db4@gmail.com>
Suyuan Wang via B4 Relay <devnull+shyckless.gmail.com@kernel.org>
writes:
> From: Suyuan Wang <stevewong@hust.edu.cn>
>
> smb2_check_receive() checks the response signature when signing is on,
> but a failed check is only logged:
>
> rc = smb2_verify_signature(&rqst, server);
> if (rc)
> cifs_server_dbg(VFS, "SMB signature verification returned ...",
> rc);
> ...
> return map_smb2_to_linux_error(mid->resp_buf, log_error);
>
> The status from the response is returned as usual, and the caller goes
> on to use a response whose signature is wrong. This is the path for
> synchronous and compound requests and for smb2_writev_callback(). On a
> signed but unencrypted connection, anyone who can modify the traffic
> can change e.g. a directory listing or file attributes, and the client
> accepts it.
>
> Return the verification error instead. That alone is not enough for
> compound_send_recv(), which still hands the response buffer to the
> caller after check_receive() fails. smb2_compound_op() then maps the
> status from that buffer again and copies the payload out, and other
> callers look at the buffer on error too, e.g. smb2_open_file() parses
> a symlink target out of a STATUS_STOPPED_ON_SYMLINK response. So also
> mark the mid MID_RESPONSE_MALFORMED, and have compound_send_recv() handle
> it like a mid in a bad state: mark the earlier mids cancelled, so that a
> CREATE which did succeed gets its handle closed, and don't pass any
> response on.
>
> Unlike the SMB1 fix in commit dc96f01d54cc ("smb: client: terminate
> session upon failed client required signing"), don't reconnect: this
> runs in the thread that sent the request, and only cifsd should call
> cifs_reconnect(). And fail the request whichever side required signing,
> since a response with a bad signature can't be trusted either way.
> ...
Applied.
next prev parent reply other threads:[~2026-11-18 22:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 4:06 [PATCH v2 0/2] smb: client: don't use SMB2 responses that fail signature verification Suyuan Wang via B4 Relay
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-18 22:02 ` Paulo Alcantara [this message]
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
2026-11-18 22:02 ` Paulo Alcantara
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=696b8c3e063478965da1084ffae1d6cf@manguebit.org \
--to=pc@manguebit.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=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®