Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2197954/?format=api
{ "id": 2197954, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2197954/?format=api", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/1.0/projects/12/?format=api", "name": "Linux CIFS Client", "link_name": "linux-cifs-client", "list_id": "linux-cifs.vger.kernel.org", "list_email": "linux-cifs@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260218213501.136844-11-ebiggers@kernel.org>", "date": "2026-02-18T21:34:56", "name": "[10/15] smb: client: Make generate_key() return void", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "1b221dfb5138fdacfbc76dd463ef44e0999eae81", "submitter": { "id": 74690, "url": "http://patchwork.ozlabs.org/api/1.0/people/74690/?format=api", "name": "Eric Biggers", "email": "ebiggers@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260218213501.136844-11-ebiggers@kernel.org/mbox/", "series": [ { "id": 492621, "url": "http://patchwork.ozlabs.org/api/1.0/series/492621/?format=api", "date": "2026-02-18T21:34:46", "name": "AES-CMAC library", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/492621/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2197954/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-cifs+bounces-9451-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-cifs@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=c0vKBFRD;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-cifs+bounces-9451-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"c0vKBFRD\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGVHt2sbsz1xvS\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 08:38:34 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 2AD9E300C6E4\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Feb 2026 21:37:24 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id B1BB33019A4;\n\tWed, 18 Feb 2026 21:36:56 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B65D2FE575;\n\tWed, 18 Feb 2026 21:36:56 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id 54F24C19421;\n\tWed, 18 Feb 2026 21:36:55 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771450616; cv=none;\n b=TLUCR7pWE8DBQviNsT//f6Pa0dulOoBLETa9BdVnu5INIKXRBKYNWxxSp3zj2WnXhnwWSpAGhyb9Frz3ZrVRGx9yCmD5XkJtnxM9Lcvl/cT5mJdVQI7T+3UBrYi12gn3+w+NyntjsT7zupYtSyGHJS9Vnx+JisRqmNQaIqZja1U=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771450616; c=relaxed/simple;\n\tbh=LoZhuuxzNWOyrPmwe9ku8/14QhyJ8CKzIMFUQopSDgQ=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=DAr++gPo9lZFRQ7KFvGlBheQrNNE2iHJcXWEpIagIEEpaOQQeLkgWjRERWq0x0rVnXCvaQz7cEhTbwBBheR9HD+QipfUm3D3ige9GpQuVbNY6J8ikNQ+xPrHC8C0lSpsVWiUjLowsdcfL/Xl3taXD7Lo0SZi57bTqoXs1OkNR0c=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=c0vKBFRD; arc=none smtp.client-ip=10.30.226.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1771450616;\n\tbh=LoZhuuxzNWOyrPmwe9ku8/14QhyJ8CKzIMFUQopSDgQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=c0vKBFRDl5TZsypRiZLNxLu+gyGyL/z7hDpq+OPPeKBKVI4VkdjUN6evSVA+WExM4\n\t M5wEqlOBLmYXFkedkv22ojxpcmNWsKHhqYotwkXWhivyLdyWuXh6DpmlslLgzNfSFt\n\t aV8XJw8qfD0RbGBKHO9BKzaNODK7LY0h6V+UNcn9Tj2d5U6gSQ5CAdSDgN7fKUG1yA\n\t trftxnltQKqv2rFNPbkRjJNBq7qw4hrLp4KfWkfkachUqZ+60bmF1+6jsHlBZNnen9\n\t DSHxYzddUtracdqj55ayRleE2P3sNmGU0zojugQw/semrjOQZHbAjbmF9g8ZNX4pwt\n\t GpjaoIQ5XEixA==", "From": "Eric Biggers <ebiggers@kernel.org>", "To": "linux-crypto@vger.kernel.org", "Cc": "linux-kernel@vger.kernel.org,\n\tArd Biesheuvel <ardb@kernel.org>,\n\t\"Jason A . Donenfeld\" <Jason@zx2c4.com>,\n\tHerbert Xu <herbert@gondor.apana.org.au>,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinux-cifs@vger.kernel.org,\n\tlinux-wireless@vger.kernel.org,\n\tEric Biggers <ebiggers@kernel.org>", "Subject": "[PATCH 10/15] smb: client: Make generate_key() return void", "Date": "Wed, 18 Feb 2026 13:34:56 -0800", "Message-ID": "<20260218213501.136844-11-ebiggers@kernel.org>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260218213501.136844-1-ebiggers@kernel.org>", "References": "<20260218213501.136844-1-ebiggers@kernel.org>", "Precedence": "bulk", "X-Mailing-List": "linux-cifs@vger.kernel.org", "List-Id": "<linux-cifs.vger.kernel.org>", "List-Subscribe": "<mailto:linux-cifs+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-cifs+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "Since the crypto library API is now being used instead of crypto_shash,\ngenerate_key() can no longer fail. Make it return void and simplify the\ncallers accordingly.\n\nSigned-off-by: Eric Biggers <ebiggers@kernel.org>\n---\n fs/smb/client/smb2transport.c | 45 +++++++++++++----------------------\n 1 file changed, 16 insertions(+), 29 deletions(-)", "diff": "diff --git a/fs/smb/client/smb2transport.c b/fs/smb/client/smb2transport.c\nindex 716e58d1b1c9..0176185a1efc 100644\n--- a/fs/smb/client/smb2transport.c\n+++ b/fs/smb/client/smb2transport.c\n@@ -249,12 +249,12 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server,\n \t\tmemcpy(shdr->Signature, smb2_signature, SMB2_SIGNATURE_SIZE);\n \n \treturn rc;\n }\n \n-static int generate_key(struct cifs_ses *ses, struct kvec label,\n-\t\t\tstruct kvec context, __u8 *key, unsigned int key_size)\n+static void generate_key(struct cifs_ses *ses, struct kvec label,\n+\t\t\t struct kvec context, __u8 *key, unsigned int key_size)\n {\n \tunsigned char zero = 0x0;\n \t__u8 i[4] = {0, 0, 0, 1};\n \t__u8 L128[4] = {0, 0, 0, 128};\n \t__u8 L256[4] = {0, 0, 1, 0};\n@@ -279,11 +279,10 @@ static int generate_key(struct cifs_ses *ses, struct kvec label,\n \t\thmac_sha256_update(&hmac_ctx, L128, 4);\n \t}\n \thmac_sha256_final(&hmac_ctx, prfhash);\n \n \tmemcpy(key, prfhash, key_size);\n-\treturn 0;\n }\n \n struct derivation {\n \tstruct kvec label;\n \tstruct kvec context;\n@@ -298,11 +297,10 @@ struct derivation_triplet {\n static int\n generate_smb3signingkey(struct cifs_ses *ses,\n \t\t\tstruct TCP_Server_Info *server,\n \t\t\tconst struct derivation_triplet *ptriplet)\n {\n-\tint rc;\n \tbool is_binding = false;\n \tint chan_index = 0;\n \n \tspin_lock(&ses->ses_lock);\n \tspin_lock(&ses->chan_lock);\n@@ -329,42 +327,31 @@ generate_smb3signingkey(struct cifs_ses *ses,\n \t * key and store it in the channel as to not overwrite the\n \t * master connection signing key stored in the session\n \t */\n \n \tif (is_binding) {\n-\t\trc = generate_key(ses, ptriplet->signing.label,\n-\t\t\t\t ptriplet->signing.context,\n-\t\t\t\t ses->chans[chan_index].signkey,\n-\t\t\t\t SMB3_SIGN_KEY_SIZE);\n-\t\tif (rc)\n-\t\t\treturn rc;\n+\t\tgenerate_key(ses, ptriplet->signing.label,\n+\t\t\t ptriplet->signing.context,\n+\t\t\t ses->chans[chan_index].signkey,\n+\t\t\t SMB3_SIGN_KEY_SIZE);\n \t} else {\n-\t\trc = generate_key(ses, ptriplet->signing.label,\n-\t\t\t\t ptriplet->signing.context,\n-\t\t\t\t ses->smb3signingkey,\n-\t\t\t\t SMB3_SIGN_KEY_SIZE);\n-\t\tif (rc)\n-\t\t\treturn rc;\n+\t\tgenerate_key(ses, ptriplet->signing.label,\n+\t\t\t ptriplet->signing.context,\n+\t\t\t ses->smb3signingkey, SMB3_SIGN_KEY_SIZE);\n \n \t\t/* safe to access primary channel, since it will never go away */\n \t\tspin_lock(&ses->chan_lock);\n \t\tmemcpy(ses->chans[chan_index].signkey, ses->smb3signingkey,\n \t\t SMB3_SIGN_KEY_SIZE);\n \t\tspin_unlock(&ses->chan_lock);\n \n-\t\trc = generate_key(ses, ptriplet->encryption.label,\n-\t\t\t\t ptriplet->encryption.context,\n-\t\t\t\t ses->smb3encryptionkey,\n-\t\t\t\t SMB3_ENC_DEC_KEY_SIZE);\n-\t\tif (rc)\n-\t\t\treturn rc;\n-\t\trc = generate_key(ses, ptriplet->decryption.label,\n-\t\t\t\t ptriplet->decryption.context,\n-\t\t\t\t ses->smb3decryptionkey,\n-\t\t\t\t SMB3_ENC_DEC_KEY_SIZE);\n-\t\tif (rc)\n-\t\t\treturn rc;\n+\t\tgenerate_key(ses, ptriplet->encryption.label,\n+\t\t\t ptriplet->encryption.context,\n+\t\t\t ses->smb3encryptionkey, SMB3_ENC_DEC_KEY_SIZE);\n+\t\tgenerate_key(ses, ptriplet->decryption.label,\n+\t\t\t ptriplet->decryption.context,\n+\t\t\t ses->smb3decryptionkey, SMB3_ENC_DEC_KEY_SIZE);\n \t}\n \n #ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS\n \tcifs_dbg(VFS, \"%s: dumping generated AES session keys\\n\", __func__);\n \t/*\n@@ -389,11 +376,11 @@ generate_smb3signingkey(struct cifs_ses *ses,\n \t\t\t\tSMB3_GCM128_CRYPTKEY_SIZE, ses->smb3encryptionkey);\n \t\tcifs_dbg(VFS, \"ServerOut Key %*ph\\n\",\n \t\t\t\tSMB3_GCM128_CRYPTKEY_SIZE, ses->smb3decryptionkey);\n \t}\n #endif\n-\treturn rc;\n+\treturn 0;\n }\n \n int\n generate_smb30signingkey(struct cifs_ses *ses,\n \t\t\t struct TCP_Server_Info *server)\n", "prefixes": [ "10/15" ] }