From patchwork Wed May 24 01:38:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 13253199 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 822A5C7EE23 for ; Wed, 24 May 2023 01:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236502AbjEXBiw (ORCPT ); Tue, 23 May 2023 21:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232881AbjEXBiw (ORCPT ); Tue, 23 May 2023 21:38:52 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7423F135 for ; Tue, 23 May 2023 18:38:48 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f3a9ad31dbso246841e87.0 for ; Tue, 23 May 2023 18:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684892326; x=1687484326; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2vkOVKcZyZtyYOvM2WhxQYGt/Xd401tJAAdS3L4nEeE=; b=g/WYkVctiL3NIusal71tSOtcMUU+EHljzl+yARuwQnZgdcZ0GDfeDCr3N6hrpih5XS m0ffhcUlRH7kyYLAp/X14lsTskt7sm+1+yEFe5JH3ViqqPT0n02sSqOx0OZAtDQKn11r eaPqehxYiRs6r5AMedbYj6gfcU4DsHMEMTJn8hYunNPlYM77PnanrV1AkOY/FUcS5etH GumEVMCgMItyBPql0AXymHJDCBaK6KJxqWSkvjwFQf9K8Z/y53BHftWbackTBTqM/+5i +SeieC3ZDHNURcUGxwH57/ni/GpFz4M2KhAgEEOFHPzMvbUOwvjLLyDz+k1lEr23wLNS v8gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684892326; x=1687484326; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2vkOVKcZyZtyYOvM2WhxQYGt/Xd401tJAAdS3L4nEeE=; b=ClIUKoc2L6R+0vXzkWYJafLTb5RaZnFPTo+RhXQxTD4PMxEGWft1k8uWgaLEdScFWy txF4dfE16IWtLPPs+YVfCfqDhSFaJSCVfKx/igvTbPepKWWbpVckHfYSMCQ+FQ/+tP9z idhCLragEKNlGGUfylyCFEa/C8gN5kvEzK/KgEV9XSFU8CZJIaIo36UItfYv2U/v2tLw M0RsN+sPNV2H2BHoHdMr7wtLF9CW3b/FzvVpVbspCwHCkCHIj/6BsZi8qzBVk9EQskvM MaFr+AzyfJgkuLqfGApRac0SZz24VAhBWanzsJJUdmf4IWEAbyEOnbc3KhCi/dOH7BUm kWZw== X-Gm-Message-State: AC+VfDzoOYXNggjvd76n3zHdCyGyEGzzDjyvr9qJyMVRTb5AynhZF66y Rp5oXyKOH0Iy38HBllBi5PpyJOgP1/3mHemYWSkZYp7/Uy7nZix1 X-Google-Smtp-Source: ACHHUZ4UB4Ns+spW2eLGe7xpBXYHixEyQxOTD82SpxTsZ5TUEk1gSRKuEXaNn6sMSgWyl1uQgMTYyASQzbouM1HgOsg= X-Received: by 2002:a2e:960a:0:b0:2ac:7ffb:6bda with SMTP id v10-20020a2e960a000000b002ac7ffb6bdamr5411425ljh.2.1684892325999; Tue, 23 May 2023 18:38:45 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Tue, 23 May 2023 20:38:34 -0500 Message-ID: Subject: [PATCH][SMB3] display debug information better for encryption To: CIFS Cc: ronnie sahlberg Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Fix /proc/fs/cifs/DebugData to use the same case for "encryption" (ie "Encryption" with init capital letter was used in one place). In addition, if gcm256 encryption (intead of gcm128) is used on a connection to a server, note that in the DebugData as well. It now says (when gcm256 encryption negotiated): Security type: RawNTLMSSP SessionId: 0x86125800bc000b0d encrypted(gcm256) From 944aaafb5051ad6a20abe9183900f1ed69efe7a1 Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 23 May 2023 20:25:47 -0500 Subject: [PATCH] smb3: display debug information better for encryption Fix /proc/fs/cifs/DebugData to use the same case for "encryption" (ie "Encryption" with init capital letter was used in one place). In addition, if gcm256 encryption (intead of gcm128) is used on a connection to a server, note that in the DebugData as well. Signed-off-by: Steven French --- fs/cifs/cifs_debug.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index d4ed200a9471..74d2776e161f 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -108,7 +108,7 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon) if ((tcon->seal) || (tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) || (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA)) - seq_printf(m, " Encrypted"); + seq_printf(m, " encrypted"); if (tcon->nocase) seq_printf(m, " nocase"); if (tcon->unix_ext) @@ -415,8 +415,12 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) /* dump session id helpful for use with network trace */ seq_printf(m, " SessionId: 0x%llx", ses->Suid); - if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) + if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) { seq_puts(m, " encrypted"); + /* can help in debugging to show encryption type */ + if (server->cipher_type == SMB2_ENCRYPTION_AES256_GCM) + seq_puts(m, "(gcm256)"); + } if (ses->sign) seq_puts(m, " signed"); -- 2.34.1