get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/2223243/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2223243,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2223243/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260414191533.1467353-2-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": "<20260414191533.1467353-2-michael.bommarito@gmail.com>",
    "list_archive_url": null,
    "date": "2026-04-14T19:15:31",
    "name": "[1/3] ksmbd: cap response sizes in ipc_validate_msg()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c1d344feb6683b1de30441d9d24ae4e99f13b313",
    "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/20260414191533.1467353-2-michael.bommarito@gmail.com/mbox/",
    "series": [
        {
            "id": 499887,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/499887/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=499887",
            "date": "2026-04-14T19:15:31",
            "name": "ksmbd: harden IPC response arithmetic and ACE walk",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499887/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2223243/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223243/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-10820-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=CnBwQcDu;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10820-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=\"CnBwQcDu\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.219.47",
            "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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::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 4fwDX42CgMz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 05:16:04 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 534C13046F2A\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 19:15:59 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 89DA32D12F3;\n\tTue, 14 Apr 2026 19:15:56 +0000 (UTC)",
            "from mail-qv1-f47.google.com (mail-qv1-f47.google.com\n [209.85.219.47])\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 3FE49282F25\n\tfor <linux-cifs@vger.kernel.org>; Tue, 14 Apr 2026 19:15:55 +0000 (UTC)",
            "by mail-qv1-f47.google.com with SMTP id\n 6a1803df08f44-8a3b0242631so68778066d6.3\n        for <linux-cifs@vger.kernel.org>;\n Tue, 14 Apr 2026 12:15:55 -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-8aca478a70csm77229126d6.27.2026.04.14.12.15.36\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 14 Apr 2026 12:15:36 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776194156; cv=none;\n b=XA0dfJgYvuU8GhihO7c5QVXWmU3YAGZQnVZbCUYE1DC232+GtbQgGwSOaibpIXDSuNFySeYfgvKvJjg1aQdAKX6nnyKYl4z7+EVR+R7BjBhVMxFAe6wy/nlZaXxOJnHy8+lT3Iydxbe5x/AIECuftqPsbGTGI4ach2KZsHcl6sY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776194156; c=relaxed/simple;\n\tbh=JiHyAQnBgby1VcbYNnZZ0ideNFMgo0ThwRgHFgMksCA=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=qgSQx+q0VoCLKiSJ502krm1+BjkkV82gCl1mIkDijt5VUhQ8+yoOE0MoWRwxDFuSFsY3bBjQXo5uanxhMAFJfO/Pu3f5G3iHlk0VIrDkrgRw85Gt3dpUxENYQF0+WqrcmxOE0jsctkC0imv449KJQUKJhH8hv9BVBocK0YUyKO0=",
        "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=CnBwQcDu; arc=none smtp.client-ip=209.85.219.47",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1776194154; x=1776798954;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=eTJ5HC0a2hN/amf4dUG1Nu4xp3YoqCRYI98HEaqXpF0=;\n        b=CnBwQcDu36ic+hOBfxBCMmxxGxDZSSY1hVTTR1Jr901hQccQnpDmcIJmVl/0nA5JaS\n         +JZk8kq0L4tzW1hIszGuUlOtzF9oyNrZz83JzwkDLhiiGYgkwNHy+uSQcCcqFdJFpMHA\n         8NpM58bUjN/m8JnGeualKMajE+SURv3QxlFrTbY4CjIbnqKAWC90PyZca39z2egUQC/l\n         XoJIiCuJknlXfZ3g6J+JM9v6Q17W9M2WJipSjbS+woEjhfzYytr51hGuTwkf6bb7HQ/J\n         D1vGJDnDuQGiTxpqN5WMvHDSZ/0ACv2YwEBArHq5ilB1L5cLtZuUbDv8BezXSlLm71Jy\n         V4zw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776194154; x=1776798954;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=eTJ5HC0a2hN/amf4dUG1Nu4xp3YoqCRYI98HEaqXpF0=;\n        b=DfnrDDwR8iRoVTWkP3zL94RkGtoM9TtcLfqASPidmHhlTW/R7c+nAdIKuQhJ+D1i85\n         DrmP6gQWFguFbF2UVHLg+dMV8sAS7evBCbrvN1DcFRvql1XGFLNtOH1+mwGAPSmemOUv\n         enFVrWINv/WHqR4IBi/MWmHGrVUkFJAggn+yUtaxD9fFNuvUIdo00mwPZPx4jcVOdBJV\n         WpsWUDGvYpiaIPJlQiYX7PpdjbhlwEyCsHOBnwb6pUvgBJbEHu3eCaFM+swGgJHvvPQJ\n         Aj7SOTBMKI5L2vEYTYnO2HmIc1EJ5XGT5VfFlf9qWNLY/bPNhLkWOWzWzlLdEBCaPCRm\n         isSw==",
        "X-Gm-Message-State": "AOJu0Yxf8PRZbWNKE1GK2cTTDMvN0EYH3H0BNqVscSuhbUB/ozWgy1iW\n\tgDKSzdBohSbupdiqCZ84lAPDXQ51sGUx4IGpj7q7DccN96yktrCC28lv2iZURStR",
        "X-Gm-Gg": "AeBDietoj3JwWbkAsztzHHOwXryKJ+X1uzq3rMBoYoIRmy6cJOzjIKA/2nKhYPbFzFo\n\tN4EUy1jJ3PpOci+jZ/Au5r3y7iSlF80QOKKOlwspFfgEyOfT0eBW+t2UeGDFNBLXs0feBu+FOl8\n\tylcYnzG23Pfp85ESTPyTVw4MfnyJ6zco7q+Z9oU78k4cGnLUcmvm/U3M1YWPz40kJA54AwFpORD\n\tM1HN/EH3js+Tqlx0SBHmaCx3AgD46DI7W5eQsfSjJ++iOl2C1OwK+oHv1mb5aZyCWms8VgzuQWu\n\tKscM6A/0gcyOA+fa3rqZE7QEOacCls6KjzCSPmdejy0fpaDT6LJ2x+KXKYMwcPgGpcYKXYy/M/s\n\trzreO/ozmdJ2adycc9sIRkMqu6iObOd+GEDMwUGc5EOqD1DXy0DCxF26Zn27Xncgq9wrK32ntuc\n\tbp2iS0C7n7cALwUqQDmCzoUkuri8iMFo3s1HT5j2f42vT76aOSnfhcj+iNbk6Q5tPT55DCBqCss\n\twTzKIcnpi+lhhaJGictljUqHYB0Udc=",
        "X-Received": "by 2002:a05:6214:e42:b0:8ac:abc5:8762 with SMTP id\n 6a1803df08f44-8acabc58abcmr147012646d6.31.1776194137524;\n        Tue, 14 Apr 2026 12:15:37 -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": "Sergey Senozhatsky <senozhatsky@chromium.org>,\n\tTom Talpey <tom@talpey.com>,\n\tstable@vger.kernel.org",
        "Subject": "[PATCH 1/3] ksmbd: cap response sizes in ipc_validate_msg()",
        "Date": "Tue, 14 Apr 2026 15:15:31 -0400",
        "Message-ID": "<20260414191533.1467353-2-michael.bommarito@gmail.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260414191533.1467353-1-michael.bommarito@gmail.com>",
        "References": "<20260414191533.1467353-1-michael.bommarito@gmail.com>",
        "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": "ipc_validate_msg() computes the expected message size for each\nresponse type by adding (or multiplying) attacker-controlled fields\nfrom the daemon response to a fixed struct size in unsigned int\narithmetic.  Three cases can overflow:\n\n  KSMBD_EVENT_RPC_REQUEST:\n      msg_sz = sizeof(struct ksmbd_rpc_command) + resp->payload_sz;\n  KSMBD_EVENT_SHARE_CONFIG_REQUEST:\n      msg_sz = sizeof(struct ksmbd_share_config_response) +\n               resp->payload_sz;\n  KSMBD_EVENT_LOGIN_REQUEST_EXT:\n      msg_sz = sizeof(struct ksmbd_login_response_ext) +\n               resp->ngroups * sizeof(gid_t);\n\nresp->payload_sz is __u32 and resp->ngroups is __s32.  Each addition\ncan wrap in unsigned int; the multiplication by sizeof(gid_t) mixes\nsigned and size_t, so a negative ngroups is converted to SIZE_MAX\nbefore the multiply.  A wrapped value of msg_sz that happens to\nequal entry->msg_sz bypasses the size check on the next line, and\ndownstream consumers (smb2pdu.c:6742 memcpy using rpc_resp->payload_sz,\nkmemdup in ksmbd_alloc_user using resp_ext->ngroups) then trust the\nunverified length.\n\nThis is the response-side analogue of aab98e2dbd64 (\"ksmbd: fix\ninteger overflows on 32 bit systems\"), which hardened the request\nside by bounding attacker-controlled lengths against the existing\nKSMBD_IPC_MAX_PAYLOAD / NGROUPS_MAX caps.  Apply the same caps on\nthe response side: reject resp->payload_sz > KSMBD_IPC_MAX_PAYLOAD\nfor RPC_REQUEST and SHARE_CONFIG_REQUEST, and reject resp->ngroups\noutside the signed [0, NGROUPS_MAX] range for LOGIN_REQUEST_EXT.\nWith those caps the subsequent additions and multiplication are\nbounded well below UINT_MAX.\n\nFixes: 0626e6641f6b (\"cifsd: add server handler for central processing and tranport layers\")\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_ipc.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)\n\n--\n2.53.0",
    "diff": "diff --git a/fs/smb/server/transport_ipc.c b/fs/smb/server/transport_ipc.c\n--- a/fs/smb/server/transport_ipc.c\n+++ b/fs/smb/server/transport_ipc.c\n@@ -497,6 +497,8 @@ static int ipc_validate_msg(struct ipc_msg_table_entry *entry)\n \t{\n \t\tstruct ksmbd_rpc_command *resp = entry->response;\n\n+\t\tif (resp->payload_sz > KSMBD_IPC_MAX_PAYLOAD)\n+\t\t\treturn -EINVAL;\n \t\tmsg_sz = sizeof(struct ksmbd_rpc_command) + resp->payload_sz;\n \t\tbreak;\n \t}\n@@ -513,7 +515,8 @@ static int ipc_validate_msg(struct ipc_msg_table_entry *entry)\n \t\tstruct ksmbd_share_config_response *resp = entry->response;\n\n \t\tif (resp->payload_sz) {\n-\t\t\tif (resp->payload_sz < resp->veto_list_sz)\n+\t\t\tif (resp->payload_sz < resp->veto_list_sz ||\n+\t\t\t    resp->payload_sz > KSMBD_IPC_MAX_PAYLOAD)\n \t\t\t\treturn -EINVAL;\n\n \t\t\tmsg_sz = sizeof(struct ksmbd_share_config_response) +\n@@ -526,6 +529,8 @@ static int ipc_validate_msg(struct ipc_msg_table_entry *entry)\n \t\tstruct ksmbd_login_response_ext *resp = entry->response;\n\n \t\tif (resp->ngroups) {\n+\t\t\tif (resp->ngroups < 0 || resp->ngroups > NGROUPS_MAX)\n+\t\t\t\treturn -EINVAL;\n \t\t\tmsg_sz = sizeof(struct ksmbd_login_response_ext) +\n \t\t\t\t\tresp->ngroups * sizeof(gid_t);\n \t\t}\n",
    "prefixes": [
        "1/3"
    ]
}