Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2223264/?format=api
{ "id": 2223264, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2223264/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260414225438.2210243-1-michael.bommarito@gmail.com/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260414225438.2210243-1-michael.bommarito@gmail.com>", "list_archive_url": null, "date": "2026-04-14T22:54:38", "name": "smb: server: fix active_num_conn leak on transport allocation failure", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5068da5fbacb50bff603a98fa042ce5091a817aa", "submitter": { "id": 93078, "url": "http://patchwork.ozlabs.org/api/1.2/people/93078/?format=api", "name": "Michael Bommarito", "email": "michael.bommarito@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260414225438.2210243-1-michael.bommarito@gmail.com/mbox/", "series": [ { "id": 499899, "url": "http://patchwork.ozlabs.org/api/1.2/series/499899/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=499899", "date": "2026-04-14T22:54:38", "name": "smb: server: fix active_num_conn leak on transport allocation failure", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499899/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2223264/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2223264/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10821-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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=n0kBa/tN;\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-10821-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"n0kBa/tN\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.219.51", "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com" ], "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 4fwKNX3HSKz1yHM\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 08:54:52 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 83A8D300722D\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 22:54:50 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 809643A9DA4;\n\tTue, 14 Apr 2026 22:54:47 +0000 (UTC)", "from mail-qv1-f51.google.com (mail-qv1-f51.google.com\n [209.85.219.51])\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 235A038A709\n\tfor <linux-cifs@vger.kernel.org>; Tue, 14 Apr 2026 22:54:46 +0000 (UTC)", "by mail-qv1-f51.google.com with SMTP id\n 6a1803df08f44-899d6b7b073so62559116d6.2\n for <linux-cifs@vger.kernel.org>;\n Tue, 14 Apr 2026 15:54:46 -0700 (PDT)", "from server0 (c-68-48-65-54.hsd1.mi.comcast.net. [68.48.65.54])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8aca9f7e0b0sm70648316d6.11.2026.04.14.15.54.43\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 14 Apr 2026 15:54:44 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776207287; cv=none;\n b=JYN7SbBXDxF+IgxV2JaTlolJK4QG4x5LUHb4PysPuPeuc4X12gfrhECRB0t7VViAY8wVCfWKdkzY8+RC4Or6TR8ZM8Jb6zTAOj18aHyfnQ8Gszjd8ZjQV71ubWX8mnit1hoRwPL0BVN69t212PMaa6z9UPFr0HT+bSFZzLHnxco=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776207287; c=relaxed/simple;\n\tbh=ho6A2HcxcWcGu1Rs/FicjzU6aBukuBzdo9A82COYqT4=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=Wf0k/mu7YuW/nXgxZVL6Uc+SE5tB1XC6NCmGEd6K2vyzedq4voOyqAuIX1mIILlyvg2iPkeIQlM+Wl01x++3nPMoo4NqQSjqfqoct+vJuQO7KHIkgmTYRDpOx9PwujYRtFN9p+mpcZB53Ga3qhpjBwYmKYDUifkw5EyT2ac1g3k=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=n0kBa/tN; arc=none smtp.client-ip=209.85.219.51", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776207285; x=1776812085;\n darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=NaXGnHrbdCiIDMKHtNSSlUWGn4HDHfRgUpLhX60Y0kQ=;\n b=n0kBa/tNgYA7MjP0BOt5GCqSEI+gzP29KqZZ5YLKRqdgPAj7zDBq500Jt5ARiItXc8\n 56ykvObPRKDuCKn0bZl73DGw+5/uKFBS45kTK3zLArp2iJ5qPfBzHeCdXCckCLIWJYd0\n 6t9ioGjnPsri1G30PoOUWGiZRkcFvCVyxHdjwXt7eR42yshiaubcT1b9zjviPPqpxD20\n hLjwMvkMdJZYitU3EZvNcX9E1FaaNfWWjG0s3KnJNfkTF2xYEQPjEWtdlsNepGs1c+8k\n xYmedJVWrYc6WZLxrVCSOegQX+sXE1laCwlEWrnIfSNUOXiC71oTt3jJEcW/wWZwjRKa\n ucwg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776207285; x=1776812085;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=NaXGnHrbdCiIDMKHtNSSlUWGn4HDHfRgUpLhX60Y0kQ=;\n b=DstfmpNrkgpXP/o8AgZWwwG00BuU+ORYToDpJKv5TWniUUty8LJmfPmXERsX8/iRC7\n 0V4675bozUao9sb2ZU0orAyYzozjieAJrYnlIIY+RU3RCjQnE6ZJRDDedMcS+ZCa1TQM\n /P04KDaFaAnqmKcTpDt+gmaIeDBz9zhJJnSLqZ8MxmmARRj/StE1YW5xt8DeKjnIHEV+\n Kd3ZCA5vWHQsH9IksMd/cFcYyVEIpgxLyY3++Y0B0aGRNxQp+Zh//KerGWhIKNYw4SS5\n QLQlPL2WSFL6aqsAUJkMJZDnpACi/ffDGLyhGWpEhKdIVgsfBvZACwLUj4igPFUTiHdv\n 5Dzw==", "X-Gm-Message-State": "AOJu0YwZvot8v20L42ioDZpr+q5AFdJGf7stlR9MkgF79yePSc1rB7hC\n\tz1ZPm2FtbaH7wT2AdJuaG/wXznwhHNuF/cpUbud2sJoVR3j8yYCpddITtP6iEg==", "X-Gm-Gg": "AeBDieuu2/n6d0NbqdKZPohVEP+7KSjemtKn8+OEZ9YCicO/UPJO5D4eaK/avRqh4O3\n\tfFIzCZ+OrEppoGksHJmIrJ116fdzNGekANaUWst+dtxaqlmkw1Ua2PYaXJZvM9yAUEkpCDb16Hx\n\tUsgxZEg1/L6uokLp2fcIRRP224/OXEaX0ME0HfN24d0XYAeOveKJKZKSMU6A0OkgeXbvIpQzN9G\n\tvZNftBiXi2AovVIi7auXucWaSnV8ZnP8biD/2dWLK13s/0mQ1Udk92ZAChh6Lnt8XznFnIqvDa5\n\tW7arKdwmKM7N5t2LxA3W+1aDBxz1LT0c3FVGAGYjtrz+0bn71jt7g7so+5hKRDqWh4hUjZZreH4\n\tNbOzv6EspkOs/XzUQcWcG11XhKj6YYhhZNXkxdtlnFMffOeiWJM19S98o/VOPuJK2Y//Px2cIce\n\tkg2obiC1glVTo7o4gcz/HOCtphmHi6PmICPiZTus0v/mHR//A1hTw/gHX97S/L5lzB3Bw/V4JKn\n\tu2qk8lrucRtd2BX2u1OOz6BaHSKNJw=", "X-Received": "by 2002:a05:6214:808a:b0:89c:bcbd:c26e with SMTP id\n 6a1803df08f44-8ac862e0e88mr291184596d6.25.1776207284790;\n Tue, 14 Apr 2026 15:54:44 -0700 (PDT)", "From": "Michael Bommarito <michael.bommarito@gmail.com>", "To": "linux-cifs@vger.kernel.org,\n\tNamjae Jeon <linkinjeon@kernel.org>,\n\tSteve French <smfrench@gmail.com>", "Cc": "Henrique Carvalho <henrique.carvalho@suse.com>,\n\tSergey Senozhatsky <senozhatsky@chromium.org>,\n\tTom Talpey <tom@talpey.com>,\n\tstable@vger.kernel.org", "Subject": "[PATCH] smb: server: fix active_num_conn leak on transport allocation\n failure", "Date": "Tue, 14 Apr 2026 18:54:38 -0400", "Message-ID": "<20260414225438.2210243-1-michael.bommarito@gmail.com>", "X-Mailer": "git-send-email 2.53.0", "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": "Commit 77ffbcac4e56 (\"smb: server: fix leak of active_num_conn in\nksmbd_tcp_new_connection()\") addressed the kthread_run() failure\npath. The earlier alloc_transport() == NULL path in the same\nfunction has the same leak, is reachable pre-authentication via any\nTCP connect to port 445, and was empirically reproduced on UML\n(ARCH=um, v7.0-rc7): a small number of forced allocation failures\nwere sufficient to put ksmbd into a state where every subsequent\nconnection attempt was rejected for the remainder of the boot.\n\nksmbd_kthread_fn() increments active_num_conn before calling\nksmbd_tcp_new_connection() and discards the return value, so when\nalloc_transport() returns NULL the socket is released and -ENOMEM\nreturned without decrementing the counter. Each such failure\npermanently consumes one slot from the max_connections pool; once\ncumulative failures reach the cap, atomic_inc_return() hits the\nthreshold on every subsequent accept and every new connection is\nrejected. The counter is only reset by module reload.\n\nAn unauthenticated remote attacker can drive the server toward the\nmemory pressure that makes alloc_transport() fail by holding open\nconnections with large RFC1002 lengths up to MAX_STREAM_PROT_LEN\n(0x00FFFFFF); natural transient allocation failures on a loaded\nhost produce the same drift more slowly.\n\nMirror the existing rollback pattern in ksmbd_kthread_fn(): on the\nalloc_transport() failure path, decrement active_num_conn gated on\nserver_conf.max_connections.\n\nRepro details: with the patch reverted, forced alloc_transport()\nNULL returns leaked counter slots and subsequent connection\nattempts -- including legitimate connects issued after the\nforced-fail window had closed -- were all rejected with \"Limit the\nmaximum number of connections\". With this patch applied, the same\nconnect sequence produces no rejections and the counter cycles\ncleanly between zero and one on every accept.\n\nFixes: 0d0d4680db22 (\"ksmbd: add max connections parameter\")\nCc: stable@vger.kernel.org\nAssisted-by: Claude:claude-opus-4-6\nAssisted-by: Codex:gpt-5-4\nSigned-off-by: Michael Bommarito <michael.bommarito@gmail.com>\n---\n fs/smb/server/transport_tcp.c | 2 ++\n 1 file changed, 2 insertions(+)", "diff": "diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c\nindex 7e29b06820e2..8d7fe71f525c 100644\n--- a/fs/smb/server/transport_tcp.c\n+++ b/fs/smb/server/transport_tcp.c\n@@ -183,6 +183,8 @@ static int ksmbd_tcp_new_connection(struct socket *client_sk)\n \tt = alloc_transport(client_sk);\n \tif (!t) {\n \t\tsock_release(client_sk);\n+\t\tif (server_conf.max_connections)\n+\t\t\tatomic_dec(&active_num_conn);\n \t\treturn -ENOMEM;\n \t}\n \n", "prefixes": [] }