From patchwork Mon Nov 13 14:52:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anastasia Belova X-Patchwork-Id: 164525 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1254495vqg; Mon, 13 Nov 2023 06:53:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IEu82brqlUIYe8Xq9LVIPAH8zRKhbnKntxxvB4CeOOY0vyxZfk5PxJbp73AukzWoBsfQX/O X-Received: by 2002:a05:6870:ab88:b0:1ef:d51b:5f50 with SMTP id gs8-20020a056870ab8800b001efd51b5f50mr9347323oab.22.1699887214293; Mon, 13 Nov 2023 06:53:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699887214; cv=none; d=google.com; s=arc-20160816; b=aHJFJFw2ZL7NArHHW3lnHTewrBH5yRYXzEh25DKe0yfa6OgrN3++rw/XuI43gMrPjN D5QCQORnqE59F6uPoI0UOrjkESXMXvV+OCCTnTemBbouZre8fuKBjAOZiVqSUAkKzP3B vCSmMNqEVvYhoTMwz+Xtr/PN6hYJeR8E8Vb+QueNbco5GRw284hENAMnhQvfAnfRlPx4 dXFynu7iLEk8EluiO0UBDvi9b1VAppEvm8+EojtGDLxv6HkJyMYhb3AIEAURqDrz7Hz8 7wcG4nQ7YqF0SYjihOTDUMfkwD3VnIJMGNQpFjqjMOrgZ5gFGZ/Lqt83NRyFEnv/aScP PlwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Q6TRajsywYnMO7rH8A/7lj1TcV++XJR+Zyc1AgOiW2E=; fh=tfp/sCXqF4t1YaQtm8fhUM4k7le1ooK/HFg9fUf5j94=; b=vy93Q056BO52TJ7WT5hA/G0UBheK2BgttkYey34/kGZV35BlLjgm3ND6HVVEeQlv2S +gbl59yvbHiAoe9FhS/IVbV4r18tAyOAvXoR3nNFkzNRKJ4Wunc3K8CgVB49W4Bska7z ivGRFBAVAWSBF7gEmsYn4AEFcQyIVRus55U57UEa6bWOOpcUM9/1Ht5gyM/KZSH2/9gX mD1tmFNBrOWWAurhLtMRXH7liTOumSiJM16dwC65mvkIyda7oMVj5YBA0pVxiDghcA+S 33JllLJJsg3K9xS6UF7An9VYteUSe3wJ1zE9KeJuk+ENIi0GHQSIV89UdLf1rSxDCkTc XgdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id bm25-20020a656e99000000b005bd27be66e1si6128103pgb.719.2023.11.13.06.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 06:53:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E378B8078324; Mon, 13 Nov 2023 06:53:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230269AbjKMOxV (ORCPT + 29 others); Mon, 13 Nov 2023 09:53:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbjKMOxT (ORCPT ); Mon, 13 Nov 2023 09:53:19 -0500 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F13BC1727; Mon, 13 Nov 2023 06:53:14 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 617051869BC8; Mon, 13 Nov 2023 17:53:11 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nYCq2uBFoeUm; Mon, 13 Nov 2023 17:53:11 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 6BE171869B23; Mon, 13 Nov 2023 17:53:10 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zc-H-Ba6Jp82; Mon, 13 Nov 2023 17:53:10 +0300 (MSK) Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.20.25]) by mail.astralinux.ru (Postfix) with ESMTPSA id 365101863BDD; Mon, 13 Nov 2023 17:53:08 +0300 (MSK) From: Anastasia Belova To: Steve French Cc: Anastasia Belova , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Jeff Layton , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Ekaterina Esina Subject: [PATCH] cifs: spnego: add ';' in HOST_KEY_LEN Date: Mon, 13 Nov 2023 17:52:32 +0300 Message-Id: <20231113145232.12448-1-abelova@astralinux.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 13 Nov 2023 06:53:31 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782460935911586885 X-GMAIL-MSGID: 1782460935911586885 "host=" should start with ';' (as in cifs_get_spnego_key) So its length should be 6. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 7c9c3760b3a5 ("[CIFS] add constants for string lengths of keynames in SPNEGO upcall string") Signed-off-by: Anastasia Belova Co-developed-by: Ekaterina Esina Signed-off-by: Ekaterina Esina Reviewed-by: Paulo Alcantara (SUSE) --- fs/smb/client/cifs_spnego.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/smb/client/cifs_spnego.c b/fs/smb/client/cifs_spnego.c index 6f3285f1dfee..af7849e5974f 100644 --- a/fs/smb/client/cifs_spnego.c +++ b/fs/smb/client/cifs_spnego.c @@ -64,8 +64,8 @@ struct key_type cifs_spnego_key_type = { * strlen(";sec=ntlmsspi") */ #define MAX_MECH_STR_LEN 13 -/* strlen of "host=" */ -#define HOST_KEY_LEN 5 +/* strlen of ";host=" */ +#define HOST_KEY_LEN 6 /* strlen of ";ip4=" or ";ip6=" */ #define IP_KEY_LEN 5