Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2224126/?format=api
{ "id": 2224126, "url": "http://patchwork.ozlabs.org/api/patches/2224126/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260416211735.3558718-1-charsyam@gmail.com/", "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": "<20260416211735.3558718-1-charsyam@gmail.com>", "list_archive_url": null, "date": "2026-04-16T21:17:35", "name": "smb: server: fix max_connections off-by-one in tcp accept path", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "7bfbec8bc3762d976f423ae88398217ac17e2c94", "submitter": { "id": 93166, "url": "http://patchwork.ozlabs.org/api/people/93166/?format=api", "name": "CharSyam", "email": "charsyam@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260416211735.3558718-1-charsyam@gmail.com/mbox/", "series": [ { "id": 500207, "url": "http://patchwork.ozlabs.org/api/series/500207/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=500207", "date": "2026-04-16T21:17:35", "name": "smb: server: fix max_connections off-by-one in tcp accept path", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500207/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2224126/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2224126/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10874-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=q70FK54Y;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10874-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=\"q70FK54Y\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.180", "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 sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::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 4fxW7f6qkYz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 07:17:50 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 4FE523016515\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 21:17:47 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 8B7E2372EE2;\n\tThu, 16 Apr 2026 21:17:45 +0000 (UTC)", "from mail-pf1-f180.google.com (mail-pf1-f180.google.com\n [209.85.210.180])\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 53519373C04\n\tfor <linux-cifs@vger.kernel.org>; Thu, 16 Apr 2026 21:17:44 +0000 (UTC)", "by mail-pf1-f180.google.com with SMTP id\n d2e1a72fcca58-8296e257735so4622b3a.1\n for <linux-cifs@vger.kernel.org>;\n Thu, 16 Apr 2026 14:17:44 -0700 (PDT)", "from ser8.. ([221.156.231.192])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82f674140d3sm6134414b3a.44.2026.04.16.14.17.41\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 16 Apr 2026 14:17:43 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776374265; cv=none;\n b=eTxg5KiCSZdDUtNLgQQ3qmqMs9yq6o9j1zalwGaA0AAgNMm4M/xJxg0Rq8Ei/1qcEdxSepTAWBbKcNjtlSWJdDQwj8hAHm105QVgWfMFtyME56hGbDgvf1W0VIJmzDy2nouwEG7/wuf5uFIVIjcFPYEuUJM+0nVCePmGqsgqtZE=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776374265; c=relaxed/simple;\n\tbh=ygvlKmBj9cpYvhipO2GVwDfNG6msc7IzLgEFKCeFaeI=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=PfiQTW1pvOn2V2bt7jMlMO0+MLnYxwzZEE/7EHgva5tz0OEO1YNuq7u9dNTT0nISrRyuCHbQUEpRrRz/9dVnop0Y8ixdeVe7vWvCeAN0ntgKuSPHdLfYUAUoH8VAvcH8dygTjs47VgPdGRbo/cMotFb1DIkOzCiTJzoR4oFBuZo=", "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=q70FK54Y; arc=none smtp.client-ip=209.85.210.180", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776374264; x=1776979064;\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=Ird1RbhcLmo1n1pSfDlmYxFmBRF3j4BNyuXGOX68NCU=;\n b=q70FK54YViXIXpJuaikoZYxg2xKb2W0PEU3gTf7E9f4UcF2I+nBTCHkJVIwmznLZvz\n k9qKpgYN2rfZMb/eowl0luvVUNeFc3c2wv/YGpFx/IGPEH93MTo/gRgklJUZ4RWuiMEG\n OT4I1BufWDpQEX/kT7CA9+i3sjHtoHtI61YOFgtdWuDkgni4JM+pOhY3ntAqCop2uoSA\n Hp9FIie8sVxBWE6ACoXxeBIL5H/5CTypV4ULIfKdTWtbooKcRxidYxZuGE0B0O6+mcpG\n I2ze6Pa4Ckpvx+b8FY9il9Z+Cd6xOdmLAd1oPguVwwaXJD0+PJM3kdV36ShlPxDkY7Jv\n mHBQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776374264; x=1776979064;\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=Ird1RbhcLmo1n1pSfDlmYxFmBRF3j4BNyuXGOX68NCU=;\n b=SxGRSViOLIHQIT1tM85kl7HARVyTcgbz+L8tOlgO+qr7uwK7gLMxp8GwYhQZN2Dsct\n QuZWwJyWYmyy5HqQ94giDUGrXy1FdFgIwEJZiHCCia9W+ffXRa8Q8//2icbXZllthlap\n kIvlR/b2gHfFvYzl8O7bveFKAsMZagHAZ0x6Ze3wyEksPJ4AGhJthVpSZQKHj9TUAJF6\n Eijh/MvBTzW5yk3vLQzGfCpl4F0aQfnM4JER8s6Nw4qF4guhg9TbqdmVzXm3x43D/LIh\n XP9aCwnz+8mS+K9ZHiqH4BLme2+ItJMjc76wDIg1f6LnTjkgSPkQUFPI0vz2rn1Xl6zM\n UBoA==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ9BqUSD65Q7lawF6IwH8B/zrTnOK9E9MGzv3UJg8LhL7Y7+3apYV1ks6Dr4loSIV67XXWuf0/isONJH@vger.kernel.org", "X-Gm-Message-State": "AOJu0Yzcef0byuVQW3JbrMPdYzwpvl2KDLKMEdoTTBkd1cHX6+V0ABFC\n\tG5HKvldYtSyK342Vmjj2Y8Swws2qUONpLMt21QQER1e31iUqHkzCIhui", "X-Gm-Gg": "AeBDievMXs616/Jf5yRIEzoJNULh0YO1WlEt+bRaRg32J091og2frTAT+UvTcl9gAA5\n\t7KxcZDVTTydt/RfhM8WGVDpWqueEb5rZQ4Zkq+VjY+kbZcvg27+lMsmGqa5huJSSq/E5RGYx6AN\n\tZBm9sDJ2nDoc+D5TuVrKQGJf4Gvcu9U4CZF/Cb4eSG+uyTQbEmcbKfRYQsfiMv0lC31n+kRuo/f\n\tx/5Y1KenQwKA9vWVVSaCFPXQswuXoNl6up2CSt9F+QqTs2v0D87WctTVTZr4zI2ruI48jXip54I\n\tLbCp+VvUsVoW57G4bMcqna2oTwzCZFv2OLbt1WvG7cA9hkssb+MCdUC7pljBL1i6LYC9ULW54yy\n\tOzFo3dFh7+hspy2fN32rBfEsQHoHbSnFddO9E4jMFs5+ANAC2JjanrPTcEXIAo5+5P1NVAQnJGD\n\totxyAz2Zafatmnvn4xBrkXbN2eD9o=", "X-Received": "by 2002:a05:6a00:1994:b0:82c:24a9:d5e5 with SMTP id\n d2e1a72fcca58-82f88563412mr472762b3a.2.1776374263639;\n Thu, 16 Apr 2026 14:17:43 -0700 (PDT)", "From": "DaeMyung Kang <charsyam@gmail.com>", "To": "Namjae Jeon <linkinjeon@kernel.org>,\n\tSteve French <smfrench@gmail.com>", "Cc": "Sergey Senozhatsky <senozhatsky@chromium.org>,\n\tTom Talpey <tom@talpey.com>,\n\tlinux-cifs@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tstable@vger.kernel.org,\n\tDaeMyung Kang <charsyam@gmail.com>", "Subject": "[PATCH] smb: server: fix max_connections off-by-one in tcp accept\n path", "Date": "Fri, 17 Apr 2026 06:17:35 +0900", "Message-ID": "<20260416211735.3558718-1-charsyam@gmail.com>", "X-Mailer": "git-send-email 2.43.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": "The global max_connections check in ksmbd's TCP accept path counts\nthe newly accepted connection with atomic_inc_return(), but then\nrejects the connection when the result is greater than or equal to\nserver_conf.max_connections.\n\nThat makes the effective limit one smaller than configured. For\nexample:\n\n- max_connections=1 rejects the first connection\n- max_connections=2 allows only one connection\n\nThe per-IP limit in the same function uses <= correctly because it\ncounts only pre-existing connections. The global limit instead checks\nthe post-increment total, so it should reject only when that total\nexceeds the configured maximum.\n\nFix this by changing the comparison from >= to >, so exactly\nmax_connections simultaneous connections are allowed and the next one\nis rejected. This matches the documented meaning of max_connections\nin fs/smb/server/ksmbd_netlink.h as the \"Number of maximum simultaneous\nconnections\".\n\nFixes: 0d0d4680db22 (\"ksmbd: add max connections parameter\")\nCc: stable@vger.kernel.org\nSigned-off-by: DaeMyung Kang <charsyam@gmail.com>\n---\n fs/smb/server/transport_tcp.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)", "diff": "diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c\nindex 7e29b06820e2..5e85341698c7 100644\n--- a/fs/smb/server/transport_tcp.c\n+++ b/fs/smb/server/transport_tcp.c\n@@ -279,7 +279,7 @@ static int ksmbd_kthread_fn(void *p)\n \n skip_max_ip_conns_limit:\n \t\tif (server_conf.max_connections &&\n-\t\t atomic_inc_return(&active_num_conn) >= server_conf.max_connections) {\n+\t\t atomic_inc_return(&active_num_conn) > server_conf.max_connections) {\n \t\t\tpr_info_ratelimited(\"Limit the maximum number of connections(%u)\\n\",\n \t\t\t\t\t atomic_read(&active_num_conn));\n \t\t\tatomic_dec(&active_num_conn);\n", "prefixes": [] }