From patchwork Tue Nov 7 04:42:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1860678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GH0j8J/N; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=permerror (SPF Permanent Error: More than 10 MX records returned) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-cifs+bounces-2-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) X-Greylist: delayed 409 seconds by postgrey-1.37 at legolas; Tue, 07 Nov 2023 15:49:57 AEDT Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SPbP15mPrz1yQ5 for ; Tue, 7 Nov 2023 15:49:57 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2A611280EC9 for ; Tue, 7 Nov 2023 04:43:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3E1DA20; Tue, 7 Nov 2023 04:43:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GH0j8J/N" X-Original-To: linux-cifs@vger.kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3219738B for ; Tue, 7 Nov 2023 04:43:02 +0000 (UTC) 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 55076FD for ; Mon, 6 Nov 2023 20:43:01 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-509109104e2so6862305e87.3 for ; Mon, 06 Nov 2023 20:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699332179; x=1699936979; darn=vger.kernel.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=4HB4n7MRJafoCUjnai4jeZh3LhBUXHcniK4G0oAK5d8=; b=GH0j8J/NiFPqBKzSzqJ1Ihy03XJKebrhxWMWl0gq77EvSnKjIkRR+d4njdG4/Skm0Y WY1ZP/kY933VrmwmlApJckAmLKrKoMGYPhgJ6lq0d3/YA7XXNzTqmeofcdZD0F6sdHXc nHQswEb2SKzjUY+fJITkpqyOZtoE17PcgYk20kO57CCuSq32o+SOG77j7sO4pW2SipyI O3q4O6TVwFXUu/dMZdmyVqaPrA0ETQS1GEUbNb9FR2gIyvH/Bs93VQAOfSH3rIgNWOBJ LZPuYLtUi7PX4V2xJ/yv4yaGleIn/Fv9X3ldDsquRv4QZs6iyNtwxvZRXeC0xTcs2/v3 3V1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699332179; x=1699936979; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4HB4n7MRJafoCUjnai4jeZh3LhBUXHcniK4G0oAK5d8=; b=NwjCfPbNYeyEH2OEA3G3L+jDmGkFQk4dEo/BE/niTP6oAUXON8Fa5msjHHBtTAX9KG 3L4NhvtxpkTRtHN95EXXSe/8TDksOi1Wov13yp3waiEoKGs+mEVMKOFQGXYI3hDAsKI3 7qlcN5xco3NkrNEyW9k8cKjqWTi+ayUywO573mM1atbVnsDIsQXGSku6dnuFM4FBZIVg PvoffCpbbPD5S7q+LMf/MLolZnxcbwY/K6fA57QOr/22WGsHyc4/rzepqF3UnLdWppKD inn6q7M2gKzo5vPpaMuKyygKt9WncRWoI7ZImWzXPLRBkCKC8HKsHWUUnByssE9ba2jI NicQ== X-Gm-Message-State: AOJu0YyBgPINcCMcwg3nxPDVdZjkR8d1u+UxNhWW2iILR2QroQqeEeXB P/RAmC2NnxXoD1iQVi/WGve//26Muz6N7rhzGDa/z7wzSPo4XRKr X-Google-Smtp-Source: AGHT+IGms/NfkW/K5ZtbD6ziMwlEUAV74QD+frdu8vrZuYDGTpM6Ktoi6GrJNT1ttGKy5x7/iboTxqP6acBK4tvKmlU= X-Received: by 2002:ac2:4e08:0:b0:509:2b57:32e with SMTP id e8-20020ac24e08000000b005092b57032emr22345815lfr.8.1699332178710; Mon, 06 Nov 2023 20:42:58 -0800 (PST) Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Steve French Date: Mon, 6 Nov 2023 22:42:47 -0600 Message-ID: Subject: Minor cleanup patch - and question about returning -ENOSYS To: CIFS Attached is another minor cleanup of comments pointed out by checkpatch ... but checkpatch also complains about these two places in sess.c (see below in select_sec function) where we return -ENOSYS (since apparently it can only be returned for invalid syscall). Any thoughts? static int select_sec(struct sess_data *sess_data) { int type; struct cifs_ses *ses = sess_data->ses; struct TCP_Server_Info *server = sess_data->server; type = cifs_select_sectype(server, ses->sectype); cifs_dbg(FYI, "sess setup type %d\n", type); if (type == Unspecified) { cifs_dbg(VFS, "Unable to select appropriate authentication method!\n"); return -EINVAL; } switch (type) { case NTLMv2: sess_data->func = sess_auth_ntlmv2; break; case Kerberos: #ifdef CONFIG_CIFS_UPCALL sess_data->func = sess_auth_kerberos; break; #else cifs_dbg(VFS, "Kerberos negotiated but upcall support disabled!\n"); return -ENOSYS; #endif /* CONFIG_CIFS_UPCALL */ case RawNTLMSSP: sess_data->func = sess_auth_rawntlmssp_negotiate; break; default: cifs_dbg(VFS, "secType %d not supported!\n", type); return -ENOSYS; } From 0bffeed013ec84084bc5090b377d2183efa8d72b Mon Sep 17 00:00:00 2001 From: Steve French Date: Mon, 6 Nov 2023 22:40:38 -0600 Subject: [PATCH] smb3: more minor cleanups for session handling routines Some trivial cleanup pointed out by checkpatch Signed-off-by: Steve French --- fs/smb/client/sess.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index 9d71c23fe234..6fd074fcae5b 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -812,8 +812,7 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifs_ses *ses, if (WARN_ON_ONCE(len < 0)) len = CIFS_MAX_DOMAINNAME_LEN - 1; bcc_ptr += len; - } /* else we will send a null domain name - so the server will default to its own domain */ + } /* else we send a null domain name so server will default to its own domain */ *bcc_ptr = 0; bcc_ptr++; @@ -909,11 +908,14 @@ static void decode_ascii_ssetup(char **pbcc_area, __u16 bleft, if (len > bleft) return; - /* No domain field in LANMAN case. Domain is - returned by old servers in the SMB negprot response */ - /* BB For newer servers which do not support Unicode, - but thus do return domain here we could add parsing - for it later, but it is not very important */ + /* + * No domain field in LANMAN case. Domain is + * returned by old servers in the SMB negprot response + * + * BB For newer servers which do not support Unicode, + * but thus do return domain here, we could add parsing + * for it later, but it is not very important + */ cifs_dbg(FYI, "ascii: bytes left %d\n", bleft); } #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ @@ -969,9 +971,12 @@ int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, ses->ntlmssp->server_flags = server_flags; memcpy(ses->ntlmssp->cryptkey, pblob->Challenge, CIFS_CRYPTO_KEY_SIZE); - /* In particular we can examine sign flags */ - /* BB spec says that if AvId field of MsvAvTimestamp is populated then - we must set the MIC field of the AUTHENTICATE_MESSAGE */ + /* + * In particular we can examine sign flags + * + * BB spec says that if AvId field of MsvAvTimestamp is populated then + * we must set the MIC field of the AUTHENTICATE_MESSAGE + */ tioffset = le32_to_cpu(pblob->TargetInfoArray.BufferOffset); tilen = le16_to_cpu(pblob->TargetInfoArray.Length); -- 2.39.2