Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.147 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795967775; b=ESXplByk6LxKVBCMOuZgOR6qgmCrLAfJea0gteNppJahjyuXTtnS4Q12NPB+4sH0hyu/ 2BAcYG2yc2TjR+z0v72aIy6sfzVzmPwFUcggUy1fLvn1legxWaO8BEQLfXX0QIxE6Ua8i 0slFRm42apI243BLDEuAA/xaCeao9d+Po6s4vh76bwnVdSSM3w8rmppfCNt9InTrTnnnY do87+jKNhQVZOOQUoFrfU/M6Xrj2BVTk0maD1Txg8RI1mqH/uhHgKu8INht0mZ+qUVi5T kd3x0FFwdp+EnvupfKyZaEG1OF0ic+OVarNEzvpPgQ8wwHLPP8rAhkyflhH596DbSdQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795967775; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding; bh=QJjFy7+zin+M6DWrqm2V54IYyhRIxUbZ6oRoLZOyY9A=; b=hN3IQuRqM5EKO2KeDw2qRy740jpvRuYfQD7bLh0+0mp0NmcomVBFCxXkJjyHo+6Ulf8Y K5AuW+Rr3oV5mrGydaukSxnL6JctEuuwQD3XyTySOgBxRjVy9zR9MOdNKUu6i3UBlYiZU 667CzRWMOwx/OOWOQ9wKXxPgRwFuis3z2BZGy/iGFOHiito2WKzwsDoApqBbFtczwOr3D lhCuRcpnaXxlllt0jJa1LUkSpLZOqYx9jrRvNeIeAVW+YyPEELT8I7l2YbD4QpA64Qjfd g+LwLsowVDRX7GBxV6VbtdtEPHTvht2usSZn6WAoS0Uim4egdQyBEVPrqZ8VfnF5EeQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=fastmail.org; spf=pass smtp.mailfrom=fastmail.org; dkim=pass header.d=fastmail.org header.i=@fastmail.org header.a=rsa-sha256 header.s=fm3 header.b=hH4n0IIe; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=bIIXf5Y9; arc=none smtp.remote-ip=103.168.172.147 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BE51606A31C for ; Sun, 29 Nov 2026 15:56:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0BE51606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=fastmail.org header.i=@fastmail.org header.a=rsa-sha256 header.s=fm3 header.b=hH4n0IIe; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=bIIXf5Y9 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 029C6EC09E9 for ; Sun, 29 Nov 2026 10:56:14 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Sun, 29 Nov 2026 10:56:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.org; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1795967773; x= 1796054173; bh=QJjFy7+zin+M6DWrqm2V54IYyhRIxUbZ6oRoLZOyY9A=; b=h H4n0IIeIOcgnc6BUPTpr93wlpiAMXzdSxmydcELx9hs9YUZTrUitP7qDpB267I3X Pka41ggYO1OpQKJk32bMDJU9ohWiQ9mS4CCeE/FYAwHDPkLDmsauZ65hSEaKBCi0 t/mK9ZLtZCJkXOwlUdc+LJ9IU5vFNsujPNdgJZji97R/G5xPnhB8XjtRxi3GeKVP PuZmhG2ikpXsvMjZjCQjSiZjKjKolbsinP/NAhY4quNdNJ1UD5XPAV7QCgRWYJbJ vfzSbroaj/fvfkSRhARyfDShmkqx96Dn5ExuACMrWyozISpU0deV3JYkQsGUXECS dQbt5Q2gvkVdadZQGOUhQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1795967773; x=1796054173; bh=Q JjFy7+zin+M6DWrqm2V54IYyhRIxUbZ6oRoLZOyY9A=; b=bIIXf5Y9Ka+xVXmrW Tl+cdo84SJlpyPVjLXCLmwaDddzxW6xXMnesXXXNlYYK9c0IhPplT8CkqaUXsyYU oiVCXRP9KPtlbcJwnD4/fAi1SZ6ChTn0MgB7Oac0D4q2XRljj2Sl+v7QqUmmu16q y0dhHE/18MdGLyb7w0LnBAHNupyJ86kFthdtR4LF67uCZ8M0XPoqZ+uYCpLOQtXy yzM2rZggqEOIBe7QCvKKSGxzeXzUbtupWq4QZpYXRAR8vd3EcpK7WwRKGUiOV6PG XuxjJqqBW4ny2LQUSWAuwFQ41KVp4NokX7KkQjYkaQdN4cA9slHlwsXxAdmKTT6+ dn5oQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=fastmail.org a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1795967773; d=fastmail.org; mf=PGljYkBmYXN0bWFpbC5vcmc+; rt=PGxpbnV4LWNpZnNAdmdlci5rZXJuZWwub3JnPg==; s=fm3:rsa-sha256:en218XT0tnswcffYUOB82JB8Ad6SGt5sz0D1kwmRUho65T8 l0ZF/3BgHg/75489+cTNDkM+tZwbIov9CwGClaSellHI8wynP1zOsFp8UhtKHLFP 7SAPHXrxQBADSkwUQErI/yHKLx8P7D7itvRpfrrQD26abRIv7+9gskmQwU2re1/8 z5jJz8JfC6nmJrtkP5wcV7myx7/6GiAx+zY2hzwRg+cttnx1QCba8ADxhHEK4cxj ktCZ14jIPCo8+TdNZHQkq7i9cm0HzBX2CXxoIhmIUgN/4B502a0LCdPzoclTIj9D SnpWGK13X4UaxxZveLhZSoDk9asDwHe1P61oZGg==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=11; hn=cc,content-transfer-encoding,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:uHWc4TjOnzNcP4Z33ZOAYczL00zoBSLXPiaoOXETrpU=:Q3GckFSsBYo4z+iGkmnI4QV7/M6pMCFKu3d6xEyLq2g=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFAIJLIVNrGQaLGwuWfRNmAASBNbR2WAeiUthp7kFY0zzQWqVS/AjpXCqsKZPzyDM YvDLlPTMlhGycsp8c4m7MykBF8qqpoBFr5y3cdbdapHQ88U7YSiZLVkebl5yNWKVK6Qc3B 0hlwhatqZwgN67r6x6f6utafWj1VfmCklh0HgNAAdSC3cAFfVCPG22sumFA4+lKFEiCmKM VW/b5tWNTLBNhd5mNYzSK0irsO7XVjq3BcUAd5d0A6kbWjWClCiCjLdgcjU2a5LAWf9bw9 jGVLTxwIfsJ7XqX9Ykz+3skcUJE4W5+ke01fWzZmo4SsED2fqdhYDmLLtfpoyAGEIWF0Ab dFWiDz0hM6buzhcqxe+z8J2fF+tvy5ntJUPUvEeV/F4Cs5Hf07+q/gVvBNo4iivgUSMh80 BpUUKeMX2DWJjMeZyd/pl4tOzUGcxJ2QAc2xyCeG4llZA+Z9v4RCE+GqFa1eGpBv6RiZa7 jBGzqf7vx+kWcXDR1JLme51xevstPHeXf8s/LuJ8KxXzpD5En3jqLw4Q1zdAdk0zQlD6U7 GJxqdI0I9hpYWKs6UJcXVh8anOzT8jeZOHzGdlNEew+WgxgxIeodn+7T78D8mm6kfMvPBk Xd53PMbSXmOpZ4LZ/dZ6UHKoveHHK9rAmTN/mABiYMmRSVO9gs1wA5LwqBog X-ME-Proxy: Feedback-ID: ib53e4b78:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Nov 2026 10:56:12 -0500 (EST) From: Ian Bridges To: nanx95726@gmail.com Cc: linkinjeon@kernel.org, tom@talpey.com, senozhatsky@chromium.org, chenxiaosong@kylinos.cn, linux-cifs@vger.kernel.org, Ian Bridges Subject: Re: [PATCH] ksmbd: bound the NTLMv2 key length by the login response hash size Date: Sun, 29 Nov 2026 09:56:07 -0600 Message-ID: <20261129155607.1935125-1-icb@fastmail.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261129135541.378902-1-nanx95726@gmail.com> References: <20261129135541.378902-1-nanx95726@gmail.com> X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > hmac_md5_init_usingrawkey(&ctx, user_passkey(sess->user), > - CIFS_ENCPWD_SIZE); > + min_t(size_t, CIFS_ENCPWD_SIZE, > + user_passkey_sz(sess->user))); With a hash shorter than 16 bytes, the login does not always fail as the commit message says. HMAC-MD5 pads a short key with zeros, so a key of n bytes acts like a 16-byte NT hash made of those bytes and then zeros. A hash of 0 bytes is then the all-zero NT hash, which any client can use. ksmbd-tools can send such a hash for a normal user. Its password database accepts an entry whose password field decodes to no bytes, such as "alice:A". I tested this on ksmbd-for-next 4543a3349127 with KASAN. With the patch, an NTLMv2 login with the all-zero NT hash succeeded for that user, and it was not a guest session. It also succeeded for a user whose field decodes to 3 zero bytes. Logins with any other hash failed. Guest accounts never reach calc_ntlmv2_hash(). Could it fail with -EINVAL when the key is shorter than CIFS_ENCPWD_SIZE?