Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217926/?format=api
{ "id": 2217926, "url": "http://patchwork.ozlabs.org/api/patches/2217926/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260331012508.17410-4-ddiss@suse.de/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/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": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260331012508.17410-4-ddiss@suse.de>", "list_archive_url": null, "date": "2026-03-31T00:37:53", "name": "[3/3] mount.cifs: remove runtime pass_length calculation", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e69e5bdfb473ee5c05fe9d27bb4b8dfa06d0904a", "submitter": { "id": 26890, "url": "http://patchwork.ozlabs.org/api/people/26890/?format=api", "name": "David Disseldorp", "email": "ddiss@suse.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260331012508.17410-4-ddiss@suse.de/mbox/", "series": [ { "id": 498116, "url": "http://patchwork.ozlabs.org/api/series/498116/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=498116", "date": "2026-03-31T00:37:50", "name": "mount.cifs: minor buflen tracking cleanups", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498116/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217926/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217926/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10592-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 (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=t/BWHn3P;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=zYZdv7xi;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=t/BWHn3P;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=zYZdv7xi;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10592-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"t/BWHn3P\";\n\tdkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"zYZdv7xi\";\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"t/BWHn3P\";\n\tdkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=\"zYZdv7xi\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=195.135.223.130", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=suse.de", "smtp-out1.suse.de;\n\tnone" ], "Received": [ "from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\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 4fl9Sr5z2pz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 12:26:52 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id C1A5630387A8\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 01:25:51 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 733C3333445;\n\tTue, 31 Mar 2026 01:25:49 +0000 (UTC)", "from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FAFB3242A4\n\tfor <linux-cifs@vger.kernel.org>; Tue, 31 Mar 2026 01:25:48 +0000 (UTC)", "from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby smtp-out1.suse.de (Postfix) with ESMTPS id 7CCC74D538;\n\tTue, 31 Mar 2026 01:25:38 +0000 (UTC)", "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A4C114A0A2;\n\tTue, 31 Mar 2026 01:25:36 +0000 (UTC)", "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n\tby imap1.dmz-prg2.suse.org with ESMTPSA\n\tid +PgqFpAiy2mpbgAAD6G6ig\n\t(envelope-from <ddiss@suse.de>); Tue, 31 Mar 2026 01:25:36 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774920349; cv=none;\n b=ZedUfYT3tX1MrMJxI3h3oz5D6K8ZhHM/SMFP7jRrPRe5q2Jv7ZElt0GftvV/sbf43oxcj7y1AOaZw5p9MLMzUhynTlJske0oZFJPTt6aeX9pjPG4ACDe9QVGTbksgwBc/7BGhdWVxPvc8mW3MfMdus5Lx6CLdvMJxtfEs9zlttE=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774920349; c=relaxed/simple;\n\tbh=jgEcLYP4Brg5vgVfJ3TKRi2QxgNPg8QApWRhtjw2bec=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=J9f6YfvywfGi4RJncOljhWWs0QWBqIIJxh0RX9x9pUO+0O1EyMVJ5c65CdqKkDZIbFZWf+s/Va+b2S2/gUlD1+ba/MIWclkR8lrhdOhWaiePkaVjwZafyxkOepw0DbyGaC0PviGQVhL3t8FkYihPHiaql4/ByveUHynPKVeB1UY=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de;\n spf=pass smtp.mailfrom=suse.de;\n dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=t/BWHn3P;\n dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=zYZdv7xi;\n dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.b=t/BWHn3P;\n dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de\n header.b=zYZdv7xi; arc=none smtp.client-ip=195.135.223.130", "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n\tt=1774920338;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=aUGJDaIHBSudwJeNXs9l7MlISSCK517Lrj/5Qy5O+78=;\n\tb=t/BWHn3PyzSxQMwZ1+r16RU3k0xdsGF1/+NFZtEqtvaCYh8iKod/jVEX4a1w3oqfLXZ2+T\n\tnnsXgeOHQahOCC3V2WUKwqH1ptk2kzAVT/VBQ3Dm7Wj8VosjXlavfscnNz4Y1Lxy+RinOz\n\tWVijqbEN8RsBEnMSKIMRtILL42fk7v0=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n\ts=susede2_ed25519; t=1774920338;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=aUGJDaIHBSudwJeNXs9l7MlISSCK517Lrj/5Qy5O+78=;\n\tb=zYZdv7xirxGY7CxIg5z/Eye5My5QPN2HDJcSXl0W+ClyQ7PMclhaR/sqz0UeuP/Km8T4aU\n\tDyNjbMiBO5yEnfBw==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n\tt=1774920338;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=aUGJDaIHBSudwJeNXs9l7MlISSCK517Lrj/5Qy5O+78=;\n\tb=t/BWHn3PyzSxQMwZ1+r16RU3k0xdsGF1/+NFZtEqtvaCYh8iKod/jVEX4a1w3oqfLXZ2+T\n\tnnsXgeOHQahOCC3V2WUKwqH1ptk2kzAVT/VBQ3Dm7Wj8VosjXlavfscnNz4Y1Lxy+RinOz\n\tWVijqbEN8RsBEnMSKIMRtILL42fk7v0=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n\ts=susede2_ed25519; t=1774920338;\n\th=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n\t mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=aUGJDaIHBSudwJeNXs9l7MlISSCK517Lrj/5Qy5O+78=;\n\tb=zYZdv7xirxGY7CxIg5z/Eye5My5QPN2HDJcSXl0W+ClyQ7PMclhaR/sqz0UeuP/Km8T4aU\n\tDyNjbMiBO5yEnfBw==" ], "From": "David Disseldorp <ddiss@suse.de>", "To": "linux-cifs@vger.kernel.org", "Cc": "Steve French <smfrench@gmail.com>,\n\tDavid Disseldorp <ddiss@suse.de>,\n\tMeetakshi Setiya <msetiya@microsoft.com>", "Subject": "[PATCH 3/3] mount.cifs: remove runtime pass_length calculation", "Date": "Tue, 31 Mar 2026 11:37:53 +1100", "Message-ID": "<20260331012508.17410-4-ddiss@suse.de>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20260331012508.17410-1-ddiss@suse.de>", "References": "<20260331012508.17410-1-ddiss@suse.de>", "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", "X-Spam-Score": "-6.80", "X-Spam-Level": "", "X-Spamd-Result": "default: False [-6.80 / 50.00];\n\tREPLY(-4.00)[];\n\tBAYES_HAM(-3.00)[99.99%];\n\tNEURAL_HAM_LONG(-1.00)[-1.000];\n\tMID_CONTAINS_FROM(1.00)[];\n\tR_MISSING_CHARSET(0.50)[];\n\tNEURAL_HAM_SHORT(-0.20)[-1.000];\n\tMIME_GOOD(-0.10)[text/plain];\n\tRCVD_COUNT_TWO(0.00)[2];\n\tARC_NA(0.00)[];\n\tRCVD_VIA_SMTP_AUTH(0.00)[];\n\tFREEMAIL_CC(0.00)[gmail.com,suse.de,microsoft.com];\n\tTO_DN_SOME(0.00)[];\n\tMIME_TRACE(0.00)[0:+];\n\tTO_MATCH_ENVRCPT_ALL(0.00)[];\n\tFUZZY_RATELIMITED(0.00)[rspamd.com];\n\tRCVD_TLS_ALL(0.00)[];\n\tDBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email];\n\tFROM_HAS_DN(0.00)[];\n\tDKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n\tFROM_EQ_ENVFROM(0.00)[];\n\tRCPT_COUNT_THREE(0.00)[4];\n\tFREEMAIL_ENVRCPT(0.00)[gmail.com]", "X-Spam-Flag": "NO" }, "content": "The parsed_mount_info.password and parsed_mount_info.password2 arrays\nare both the same length, so drop version-specific length calculations\nand use a build-time assertion to avoid future breakage.\n\nCc: Meetakshi Setiya <msetiya@microsoft.com>\nSigned-off-by: David Disseldorp <ddiss@suse.de>\n---\n mount.cifs.c | 18 ++++++++----------\n 1 file changed, 8 insertions(+), 10 deletions(-)", "diff": "diff --git a/mount.cifs.c b/mount.cifs.c\nindex 945196f..836a060 100644\n--- a/mount.cifs.c\n+++ b/mount.cifs.c\n@@ -63,6 +63,7 @@\n #include \"mount.h\"\n #include \"util.h\"\n #include \"resolve_host.h\"\n+#include \"build_assert.h\"\n \n #ifndef MS_MOVE \n #define MS_MOVE 8192 \n@@ -343,14 +344,12 @@ set_password(struct parsed_mount_info *parsed_info, const char *src,\n {\n \tint is_pass2 = which_pass == OPT_PASS2 || which_pass == CRED_PASS2;\n \n-\tchar *dst = is_pass2 ?\n-\t\t\t\tparsed_info->password2 : parsed_info->password;\n-\tunsigned int pass_length = is_pass2 ?\n-\t\t\t\t\t sizeof(parsed_info->password2) : sizeof(parsed_info->password);\n+\tchar *dst = is_pass2 ? parsed_info->password2 : parsed_info->password;\n \tunsigned int i = 0, j = 0;\n+\tBUILD_ASSERT(sizeof(parsed_info->password) == sizeof(parsed_info->password2));\n \n \twhile (src[i]) {\n-\t\tif (j + 2 >= pass_length) {\n+\t\tif (j + 2 >= sizeof(parsed_info->password)) {\n \t\t\tfprintf(stderr, \"Converted password too long!\\n\");\n \t\t\treturn EX_USAGE;\n \t\t}\n@@ -362,7 +361,8 @@ set_password(struct parsed_mount_info *parsed_info, const char *src,\n \tif (is_pass2)\n \t\tparsed_info->got_password2 = 1;\n \telse\n-\tparsed_info->got_password = 1;\n+\t\tparsed_info->got_password = 1;\n+\n \treturn 0;\n }\n \n@@ -681,10 +681,8 @@ get_password_from_file(int file_descript, char *filename,\n \t\t\t const int which_pass)\n {\n \tint rc = 0;\n-\tint is_pass2 = which_pass == OPT_PASS2;\n-\tunsigned int pass_length = is_pass2 ?\n-\t\t\t\t\t sizeof(parsed_info->password2) : sizeof(parsed_info->password);\n-\tchar buf[pass_length];\n+\tchar buf[sizeof(parsed_info->password)];\n+\tBUILD_ASSERT(sizeof(parsed_info->password) == sizeof(parsed_info->password2));\n \n \tif (filename != NULL) {\n \t\trc = toggle_dac_capability(0, 1);\n", "prefixes": [ "3/3" ] }