From: Enzo Matsumiya <ematsumiya@suse.de>
To: Wong Steve <shyckless@gmail.com>
Cc: pc@manguebit.org, linkinjeon@kernel.org,
linux-cifs@vger.kernel.org, sprasad@microsoft.com,
smfrench@gmail.com, ronniesahlberg@gmail.com,
bharathsm@microsoft.com, linux-kernel@vger.kernel.org,
daniel.birtwhistle@gehealthcare.com,
samba-technical@lists.samba.org, tom@talpey.com
Subject: Re: [PATCH] smb: client: fail SMB2 responses with a bad signature
Date: Fri, 13 Nov 2026 12:59:28 -0300 [thread overview]
Message-ID: <avcoB7XgP3i0xd9C@suse.de> (raw)
In-Reply-To: <CA+X8Sdi6adfL0jr=t9jDoJ5M+AWHxAw7NzQaVaOoT4O+awfEPA@mail.gmail.com>
On 11/13, Wong Steve wrote:
>On 11/13, Enzo Matsumiya wrote:
>> However, I still think the error should only be returned if signing is
>> required (*) AND rc == -EACCES.
>>
>> Any other error should always be returned unconditionally.
>>
>> (*) Note that "signing required" at that point means that either/both
>> client and server required signing, and the other side agreed -- it
>> doesn't really matter who asked for it.
>
>Thanks for looking at it.
>
>I think the existing server->sign check already covers that.
>cifs_enable_signing() only sets server->sign when the server requires
>signing and the client allows it, or when the client requires it (mount
>option or SecurityFlags) and the server supports it. Both sides merely
>supporting signing doesn't turn it on.
>
>smb2_verify_signature() is only called under that check, so the new
>return passes on -EACCES for a mismatch, and any other error from it
>(e.g. from smb3_calc_signature()) as well.
>
>Is there a case I'm missing where server->sign is set but signing isn't
>required in your sense?
Not really, you're 100% correct, sorry.
I just remembered that there's a very specific exception to that, and it's
currently not handled; SMB 3.1.1 tcon requests (!anonymous && !guest) are
signed unconditionally, but the responses are never verified because
they're gated by server->sign.
While your patch fix this indirectly, I couldn't find in the spec
whether such tcon responses should also fail if signing isn't required.
Anyway, I think this can be discussed later in a follow up patch.
@Paulo, @Namjae:
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Cheers,
Enzo
prev parent reply other threads:[~2026-11-13 15:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 12:00 Suyuan Wang via B4 Relay
2026-11-13 12:16 ` Enzo Matsumiya
[not found] ` <CA+X8Sdi6adfL0jr=t9jDoJ5M+AWHxAw7NzQaVaOoT4O+awfEPA@mail.gmail.com>
2026-11-13 15:59 ` Enzo Matsumiya [this message]
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=avcoB7XgP3i0xd9C@suse.de \
--to=ematsumiya@suse.de \
--cc=bharathsm@microsoft.com \
--cc=daniel.birtwhistle@gehealthcare.com \
--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®