From patchwork Sun Oct 31 01:04:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namjae Jeon X-Patchwork-Id: 12594891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A1B1C433F5 for ; Sun, 31 Oct 2021 01:04:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F56A60FC0 for ; Sun, 31 Oct 2021 01:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232058AbhJaBGr (ORCPT ); Sat, 30 Oct 2021 21:06:47 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:38492 "EHLO mail-pg1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbhJaBGr (ORCPT ); Sat, 30 Oct 2021 21:06:47 -0400 Received: by mail-pg1-f180.google.com with SMTP id e65so13701094pgc.5 for ; Sat, 30 Oct 2021 18:04:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eRFQ1Ko1HhlANB0OJdAzRtBToDc/emvxLDXUnxFxCnU=; b=eZhQec/wyiQYw0OWEJsdfL1qyUYnumUJ3yVeZO3+0+A8xayfhg1Vrsc3lF5gdwqZ4O r5WuqatRixit346M578BxIcmsQqqUaz78pXJGqcG6F6zscv0ZZrORAm46h3yPpdO/p+H D2/oekw4BpiY+GCfBWRRO7eejNlNk2SGZKZA2y/gUn4S6PMJF4Y1qKM4wvvJ2N6Vdq4v i8CZ8Xn6zcLNvXC3vtreFn99EPFAMjfiY6yNV+yNTUFJb7CLyiFs0ytEZzME5e9QpMjZ 0ucZfiSU2teYoefbXIHvm7xXjo+YZ6y9sCqvNUpEXD1lr9c77DEIQ/9Cz1Obay4AWDO8 YR3g== X-Gm-Message-State: AOAM5318CdQ/7BR5E+E5pkvf6itPq8pCOAHfQ720TunOO8wxWw10VJ49 FiOwfnXPgDdy+lkcXC9UiAMF9Zgkq24= X-Google-Smtp-Source: ABdhPJzuMfpB102Vj+i1GvpoyX+u8ZOub/K/cfMyaQ/L6v7q8TZYx5HGlXx8bDVJt/igo5YCGoyj5w== X-Received: by 2002:a63:720c:: with SMTP id n12mr14920152pgc.95.1635642256133; Sat, 30 Oct 2021 18:04:16 -0700 (PDT) Received: from localhost.localdomain ([61.74.27.164]) by smtp.gmail.com with ESMTPSA id g7sm8714843pgp.17.2021.10.30.18.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Oct 2021 18:04:15 -0700 (PDT) From: Namjae Jeon To: linux-cifs@vger.kernel.org Cc: Namjae Jeon , Steve French Subject: [PATCH 1/2] ksmbd: set unique value to volume serial field in FS_VOLUME_INFORMATION Date: Sun, 31 Oct 2021 10:04:06 +0900 Message-Id: <20211031010407.11078-1-linkinjeon@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Steve French reported ksmbd set fixed value to volume serial field in FS_VOLUME_INFORMATION. Volume serial value needs to be set to a unique value for client fscache. This patch set crc value that is generated with share name, path name and netbios name to volume serial. Reported-by: Steve French Signed-off-by: Namjae Jeon --- fs/ksmbd/Kconfig | 1 + fs/ksmbd/server.c | 1 + fs/ksmbd/smb2pdu.c | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/ksmbd/Kconfig b/fs/ksmbd/Kconfig index b83cbd756ae5..6af339cfdc04 100644 --- a/fs/ksmbd/Kconfig +++ b/fs/ksmbd/Kconfig @@ -19,6 +19,7 @@ config SMB_SERVER select CRYPTO_GCM select ASN1 select OID_REGISTRY + select CRC32 default n help Choose Y here if you want to allow SMB3 compliant clients diff --git a/fs/ksmbd/server.c b/fs/ksmbd/server.c index 2a2b2135bfde..36d368e59a64 100644 --- a/fs/ksmbd/server.c +++ b/fs/ksmbd/server.c @@ -632,5 +632,6 @@ MODULE_SOFTDEP("pre: sha512"); MODULE_SOFTDEP("pre: aead2"); MODULE_SOFTDEP("pre: ccm"); MODULE_SOFTDEP("pre: gcm"); +MODULE_SOFTDEP("pre: crc32"); module_init(ksmbd_server_init) module_exit(ksmbd_server_exit) diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index a925e0f67fb8..04f82b5870c3 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -4892,11 +4892,18 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work, { struct filesystem_vol_info *info; size_t sz; + unsigned int serial_crc = 0; info = (struct filesystem_vol_info *)(rsp->Buffer); info->VolumeCreationTime = 0; + serial_crc = crc32_le(serial_crc, share->name, + strlen(share->name)); + serial_crc = crc32_le(serial_crc, share->path, + strlen(share->path)); + serial_crc = crc32_le(serial_crc, ksmbd_netbios_name(), + strlen(ksmbd_netbios_name())); /* Taking dummy value of serial number*/ - info->SerialNumber = cpu_to_le32(0xbc3ac512); + info->SerialNumber = cpu_to_le32(serial_crc); len = smbConvertToUTF16((__le16 *)info->VolumeLabel, share->name, PATH_MAX, conn->local_nls, 0); From patchwork Sun Oct 31 01:04:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namjae Jeon X-Patchwork-Id: 12594893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD400C433EF for ; Sun, 31 Oct 2021 01:04:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9437260EE3 for ; Sun, 31 Oct 2021 01:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232063AbhJaBGu (ORCPT ); Sat, 30 Oct 2021 21:06:50 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:37527 "EHLO mail-pj1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbhJaBGt (ORCPT ); Sat, 30 Oct 2021 21:06:49 -0400 Received: by mail-pj1-f48.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so13526624pjl.2 for ; Sat, 30 Oct 2021 18:04:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xDzRyPFL4ZoTW6jptBFFTuaxBqz3qJPobEqojU738WA=; b=2MEQNtE2X2x71o9w2Y3Y+JMu9++naZWhOLtd90rwOHmVFu0oRTlfhJNCQdCsrE17Xj uXgQ6vI6nmBPodgWp8CkyCDdyXHG6mdLfX2thrUFmxk4V6t3k5NjqXZUeBH7XIk2NBXO KSY6t5ewKL6isW66NgFnWpq9MJzy5ha1ZqsVH2h+S8+9LBQeqy1SgSt5yQqX110c5QDz cLgfWVqpaCr7s/clqCVRN1WKRvA/X9Ss+4YygaRp8miG4RuoSLh8Hqo9iXaS50dIsv51 UsZ4JZiiC+MfTKOJMdD43JlnFBpx4pKVaOS/9bIwsh+uBDsNjkyDFTB8uSRAJbqgIkwa kgwA== X-Gm-Message-State: AOAM530aBu8Qb2Y++LtP9WSWLS8BVyTQNM26uWOt2VUjPyuLNhqtn7uS T0uo4Rh+x9QurjUQILh+L35aWI4YmHg= X-Google-Smtp-Source: ABdhPJxVN7yy+RPiGR2bX4/ff3X+DgH8ORPUKOjCx9ZamM+zcvxsS8tvvLdwS89K00OebEJ4lT7SfA== X-Received: by 2002:a17:902:d4cf:b0:141:d36c:78f6 with SMTP id o15-20020a170902d4cf00b00141d36c78f6mr3090328plg.56.1635642258526; Sat, 30 Oct 2021 18:04:18 -0700 (PDT) Received: from localhost.localdomain ([61.74.27.164]) by smtp.gmail.com with ESMTPSA id g7sm8714843pgp.17.2021.10.30.18.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Oct 2021 18:04:17 -0700 (PDT) From: Namjae Jeon To: linux-cifs@vger.kernel.org Cc: Namjae Jeon Subject: [PATCH 2/2] ksmbd: remove md4 leftovers Date: Sun, 31 Oct 2021 10:04:07 +0900 Message-Id: <20211031010407.11078-2-linkinjeon@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211031010407.11078-1-linkinjeon@kernel.org> References: <20211031010407.11078-1-linkinjeon@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org As NTLM authentication is removed, md4 is no longer used. ksmbd remove md4 leftovers, i.e. select CRYPTO_MD4, MODULE_SOFTDEP md4. Signed-off-by: Namjae Jeon Acked-by: Hyunchul Lee --- fs/ksmbd/Kconfig | 1 - fs/ksmbd/server.c | 1 - 2 files changed, 2 deletions(-) diff --git a/fs/ksmbd/Kconfig b/fs/ksmbd/Kconfig index 6af339cfdc04..e1fe17747ed6 100644 --- a/fs/ksmbd/Kconfig +++ b/fs/ksmbd/Kconfig @@ -6,7 +6,6 @@ config SMB_SERVER select NLS select NLS_UTF8 select CRYPTO - select CRYPTO_MD4 select CRYPTO_MD5 select CRYPTO_HMAC select CRYPTO_ECB diff --git a/fs/ksmbd/server.c b/fs/ksmbd/server.c index 36d368e59a64..2e12f6d8483b 100644 --- a/fs/ksmbd/server.c +++ b/fs/ksmbd/server.c @@ -622,7 +622,6 @@ MODULE_DESCRIPTION("Linux kernel CIFS/SMB SERVER"); MODULE_LICENSE("GPL"); MODULE_SOFTDEP("pre: ecb"); MODULE_SOFTDEP("pre: hmac"); -MODULE_SOFTDEP("pre: md4"); MODULE_SOFTDEP("pre: md5"); MODULE_SOFTDEP("pre: nls"); MODULE_SOFTDEP("pre: aes");