get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2220135,
    "url": "http://patchwork.ozlabs.org/api/1.0/patches/2220135/?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": "<2026040636-icy-constable-9e17@gregkh>",
    "date": "2026-04-06T13:49:38",
    "name": "[2/2] smb: client: fix OOB reads parsing symlink error response",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f141cceaad6e4eec0654c43b1d341ac76be47925",
    "submitter": {
        "id": 11800,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/11800/?format=api",
        "name": "Greg Kroah-Hartman",
        "email": "gregkh@linuxfoundation.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/2026040636-icy-constable-9e17@gregkh/mbox/",
    "series": [
        {
            "id": 498856,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/498856/?format=api",
            "date": "2026-04-06T13:49:37",
            "name": "smb: some potential bugfixes",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498856/mbox/"
        }
    ],
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2220135/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-10681-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=linuxfoundation.org header.i=@linuxfoundation.org\n header.a=rsa-sha256 header.s=korg header.b=Ua2KdIIw;\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-10681-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linuxfoundation.org\n header.i=@linuxfoundation.org header.b=\"Ua2KdIIw\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fq9h32BJ4z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 06 Apr 2026 23:50:27 +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 CC8EB301C913\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  6 Apr 2026 13:49:54 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 741172BDC0F;\n\tMon,  6 Apr 2026 13:49:49 +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 5069729E11D;\n\tMon,  6 Apr 2026 13:49:49 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 93C02C4CEF7;\n\tMon,  6 Apr 2026 13:49:48 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775483389; cv=none;\n b=o1k52yUyQwRaP4IknxYgnpHzPPfz158m/SJZ4VrWVz6E6+di+TC7bqc4I2PTmH5+k93MQcBWD+Ws1sKajy6PB/0KTbpKqUW47XKFvKhOBP8RrcXpHPMqMVCcUMOIsjIvbH7LLYPgyemMbY10Qbcrg7ByEX7MSvAhiTCFZvAOnW4=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775483389; c=relaxed/simple;\n\tbh=dINbbS4cKF6wwvx/bzeLOYJ+irUgy9XDiVNht/C7qLg=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=eEKktCXTxD/l0OYQ+9NdAoyGEWPu78aN/bgtr0Ew9ZfvQR3lhjbLsLzgD11AWJFRVbSmlH7kTb4ZUPT7GPNLN5lgbhZn6FC1lcRSxtpkkebjSNOFsDeEUY4CxoWMNNVQ3v0C1xkhwVdFGSYptCERHWjUk7qbkKmjWha/l+qM7tw=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (1024-bit key) header.d=linuxfoundation.org\n header.i=@linuxfoundation.org header.b=Ua2KdIIw;\n arc=none smtp.client-ip=10.30.226.201",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org;\n\ts=korg; t=1775483388;\n\tbh=dINbbS4cKF6wwvx/bzeLOYJ+irUgy9XDiVNht/C7qLg=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Ua2KdIIwBABAtHiFO3GBaPqNhzbpJxYT5dNJs78uQ4dOKEP9elP9EvXYA1wUQFChT\n\t aME3+KnRX2CkmUwexljXI4u8llr/mU6vSY169Tk9O7WgFREyfCXVYMUjoO2h7YlKrE\n\t QujcipQUSK0I5HWUEQvyChELsD3UC+WEX16h0HtE=",
        "From": "Greg Kroah-Hartman <gregkh@linuxfoundation.org>",
        "To": "linux-cifs@vger.kernel.org",
        "Cc": "linux-kernel@vger.kernel.org,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tSteve French <sfrench@samba.org>,\n\tPaulo Alcantara <pc@manguebit.org>,\n\tRonnie Sahlberg <ronniesahlberg@gmail.com>,\n\tShyam Prasad N <sprasad@microsoft.com>,\n\tTom Talpey <tom@talpey.com>,\n\tBharath SM <bharathsm@microsoft.com>,\n\tsamba-technical@lists.samba.org,\n\tstable <stable@kernel.org>",
        "Subject": "[PATCH 2/2] smb: client: fix OOB reads parsing symlink error response",
        "Date": "Mon,  6 Apr 2026 15:49:38 +0200",
        "Message-ID": "<2026040636-icy-constable-9e17@gregkh>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<2026040635-banking-unsoiled-3250@gregkh>",
        "References": "<2026040635-banking-unsoiled-3250@gregkh>",
        "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",
        "Lines": "109",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=4719;\n i=gregkh@linuxfoundation.org; h=from:subject:message-id;\n bh=dINbbS4cKF6wwvx/bzeLOYJ+irUgy9XDiVNht/C7qLg=;\n b=owGbwMvMwCRo6H6F97bub03G02pJDJmXd35I+/nxwhW+O1M5I341Cc1u5Sp4ljd7dxCzxq26h\n 6fX7xex7YhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJ+GkwLNhvPuNZ/EGTyNjf\n Z5YvPVbPFqHAuZFhvv871jOch70yOfbuaQw6kX4414O7CAA=",
        "X-Developer-Key": "i=gregkh@linuxfoundation.org; a=openpgp;\n fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "When a CREATE returns STATUS_STOPPED_ON_SYMLINK, smb2_check_message()\nreturns success without any length validation, leaving the symlink\nparsers as the only defense against an untrusted server.\n\nsymlink_data() walks SMB 3.1.1 error contexts with the loop test \"p <\nend\", but reads p->ErrorId at offset 4 and p->ErrorDataLength at offset\n0.  When the server-controlled ErrorDataLength advances p to within 1-7\nbytes of end, the next iteration will read past it.  When the matching\ncontext is found, sym->SymLinkErrorTag is read at offset 4 from\np->ErrorContextData with no check that the symlink header itself fits.\n\nsmb2_parse_symlink_response() then bounds-checks the substitute name\nusing SMB2_SYMLINK_STRUCT_SIZE as the offset of PathBuffer from\niov_base.  That value is computed as sizeof(smb2_err_rsp) +\nsizeof(smb2_symlink_err_rsp), which is correct only when\nErrorContextCount == 0.\n\nWith at least one error context the symlink data sits 8 bytes deeper,\nand each skipped non-matching context shifts it further by 8 +\nALIGN(ErrorDataLength, 8).  The check is too short, allowing the\nsubstitute name read to run past iov_len.  The out-of-bound heap bytes\nare UTF-16-decoded into the symlink target and returned to userspace via\nreadlink(2).\n\nFix this all up by making the loops test require the full context header\nto fit, rejecting sym if its header runs past end, and bound the\nsubstitute name against the actual position of sym->PathBuffer rather\nthan a fixed offset.\n\nBecause sub_offs and sub_len are 16bits, the pointer math will not\noverflow here with the new greater-than.\n\nCc: Steve French <sfrench@samba.org>\nCc: Paulo Alcantara <pc@manguebit.org>\nCc: Ronnie Sahlberg <ronniesahlberg@gmail.com>\nCc: Shyam Prasad N <sprasad@microsoft.com>\nCc: Tom Talpey <tom@talpey.com>\nCc: Bharath SM <bharathsm@microsoft.com>\nCc: linux-cifs@vger.kernel.org\nCc: samba-technical@lists.samba.org\nCc: stable <stable@kernel.org>\nAssisted-by: gregkh_clanker_t1000\nSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n---\n fs/smb/client/smb2file.c | 20 ++++++++++++--------\n 1 file changed, 12 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c\nindex ed651c946251..b292aa94a593 100644\n--- a/fs/smb/client/smb2file.c\n+++ b/fs/smb/client/smb2file.c\n@@ -27,10 +27,11 @@ static struct smb2_symlink_err_rsp *symlink_data(const struct kvec *iov)\n {\n \tstruct smb2_err_rsp *err = iov->iov_base;\n \tstruct smb2_symlink_err_rsp *sym = ERR_PTR(-EINVAL);\n+\tu8 *end = (u8 *)err + iov->iov_len;\n \tu32 len;\n \n \tif (err->ErrorContextCount) {\n-\t\tstruct smb2_error_context_rsp *p, *end;\n+\t\tstruct smb2_error_context_rsp *p;\n \n \t\tlen = (u32)err->ErrorContextCount * (offsetof(struct smb2_error_context_rsp,\n \t\t\t\t\t\t\t      ErrorContextData) +\n@@ -39,8 +40,7 @@ static struct smb2_symlink_err_rsp *symlink_data(const struct kvec *iov)\n \t\t\treturn ERR_PTR(-EINVAL);\n \n \t\tp = (struct smb2_error_context_rsp *)err->ErrorData;\n-\t\tend = (struct smb2_error_context_rsp *)((u8 *)err + iov->iov_len);\n-\t\tdo {\n+\t\twhile ((u8 *)p + sizeof(*p) <= end) {\n \t\t\tif (le32_to_cpu(p->ErrorId) == SMB2_ERROR_ID_DEFAULT) {\n \t\t\t\tsym = (struct smb2_symlink_err_rsp *)p->ErrorContextData;\n \t\t\t\tbreak;\n@@ -50,14 +50,16 @@ static struct smb2_symlink_err_rsp *symlink_data(const struct kvec *iov)\n \n \t\t\tlen = ALIGN(le32_to_cpu(p->ErrorDataLength), 8);\n \t\t\tp = (struct smb2_error_context_rsp *)(p->ErrorContextData + len);\n-\t\t} while (p < end);\n+\t\t}\n \t} else if (le32_to_cpu(err->ByteCount) >= sizeof(*sym) &&\n \t\t   iov->iov_len >= SMB2_SYMLINK_STRUCT_SIZE) {\n \t\tsym = (struct smb2_symlink_err_rsp *)err->ErrorData;\n \t}\n \n-\tif (!IS_ERR(sym) && (le32_to_cpu(sym->SymLinkErrorTag) != SYMLINK_ERROR_TAG ||\n-\t\t\t     le32_to_cpu(sym->ReparseTag) != IO_REPARSE_TAG_SYMLINK))\n+\tif (!IS_ERR(sym) &&\n+\t    ((u8 *)sym + sizeof(*sym) > end ||\n+\t     le32_to_cpu(sym->SymLinkErrorTag) != SYMLINK_ERROR_TAG ||\n+\t     le32_to_cpu(sym->ReparseTag) != IO_REPARSE_TAG_SYMLINK))\n \t\tsym = ERR_PTR(-EINVAL);\n \n \treturn sym;\n@@ -128,8 +130,10 @@ int smb2_parse_symlink_response(struct cifs_sb_info *cifs_sb, const struct kvec\n \tprint_len = le16_to_cpu(sym->PrintNameLength);\n \tprint_offs = le16_to_cpu(sym->PrintNameOffset);\n \n-\tif (iov->iov_len < SMB2_SYMLINK_STRUCT_SIZE + sub_offs + sub_len ||\n-\t    iov->iov_len < SMB2_SYMLINK_STRUCT_SIZE + print_offs + print_len)\n+\tif ((char *)sym->PathBuffer + sub_offs + sub_len >\n+\t\t(char *)iov->iov_base + iov->iov_len ||\n+\t    (char *)sym->PathBuffer + print_offs + print_len >\n+\t\t(char *)iov->iov_base + iov->iov_len)\n \t\treturn -EINVAL;\n \n \treturn smb2_parse_native_symlink(path,\n",
    "prefixes": [
        "2/2"
    ]
}