get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2224131,
    "url": "http://patchwork.ozlabs.org/api/patches/2224131/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260416200702.2374709-2-git@aaronesau.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260416200702.2374709-2-git@aaronesau.com>",
    "list_archive_url": null,
    "date": "2026-04-16T20:07:01",
    "name": "[1/2] hw/cxl: fix OOB read in Get Log command due to incorrect pointer arithmetic",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "440f95485d9e94e02d28cd961f486c5cc757e116",
    "submitter": {
        "id": 93010,
        "url": "http://patchwork.ozlabs.org/api/people/93010/?format=api",
        "name": "Aaron Esau",
        "email": "aaron1esau@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260416200702.2374709-2-git@aaronesau.com/mbox/",
    "series": [
        {
            "id": 500210,
            "url": "http://patchwork.ozlabs.org/api/series/500210/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500210",
            "date": "2026-04-16T20:07:00",
            "name": "hw/cxl: Fix two OOB access bugs in CXL mailbox commands",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500210/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224131/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224131/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.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=SDw1r8Wb;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxXwc6ySBz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 08:38:24 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wDVLZ-0007kk-NY; Thu, 16 Apr 2026 18:38:06 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <aaron1esau@gmail.com>)\n id 1wDSzo-00022Z-Cs\n for qemu-devel@nongnu.org; Thu, 16 Apr 2026 16:07:28 -0400",
            "from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <aaron1esau@gmail.com>)\n id 1wDSzm-0000He-Ri\n for qemu-devel@nongnu.org; Thu, 16 Apr 2026 16:07:28 -0400",
            "by mail-oo1-xc30.google.com with SMTP id\n 006d021491bc7-6888f36ceaaso136202eaf.2\n for <qemu-devel@nongnu.org>; Thu, 16 Apr 2026 13:07:26 -0700 (PDT)",
            "from localhost ([136.49.184.116]) by smtp.gmail.com with ESMTPSA id\n 006d021491bc7-6946044199fsm521624eaf.14.2026.04.16.13.07.24\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 16 Apr 2026 13:07:24 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776370045; x=1776974845; darn=nongnu.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=KCsFtdTDgbFc/U88ymKe8zR4zhuBtfCqsEs0LceHIRo=;\n b=SDw1r8WbJ17GV93Eh5EZSg0p2fcCToOw9DV+KM/2xjS9tIPI7UKZmcuhEwWKPdVfNC\n nN4dyg/vaA1fvD5ZZUYo9+JuONdtGV4Bs3EnFyp1XskJaQWPvtWjnTFmg/8PCETzlxCs\n 39HzRsSdyiBACYP7eSvjmjJWA/3qOJdHeJxa0+/rzLK/8md4+eq7gwJqGWUOs/hdTo0P\n SJbPniT74FfClL7YNf4JqUFfwfmfEWGqXkzXYmQGGcx3atIMk5ynEqoJWYAXfkj/NgJb\n cQw8k/ekanlRZ4tnNMNoZGV3tcmK1KJWkqO/IrtbA3xFj5fpHsv78VzXYeHDgx0NTGi9\n myTg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776370045; x=1776974845;\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=KCsFtdTDgbFc/U88ymKe8z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46dFccTbT/CrBZG6ydPU=",
        "X-Received": "by 2002:a4a:e1bc:0:b0:67e:1552:16cf with SMTP id\n 006d021491bc7-69462f04df4mr18380eaf.2.1776370045239;\n Thu, 16 Apr 2026 13:07:25 -0700 (PDT)",
        "From": "Aaron Esau <aaron1esau@gmail.com>",
        "X-Google-Original-From": "Aaron Esau <git@aaronesau.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Jonathan.Cameron@huawei.com, jic23@kernel.org, berrange@redhat.com,\n Aaron Esau <aaron1esau@gmail.com>, qemu-stable@nongnu.org",
        "Subject": "[PATCH 1/2] hw/cxl: fix OOB read in Get Log command due to incorrect\n pointer arithmetic",
        "Date": "Thu, 16 Apr 2026 15:07:01 -0500",
        "Message-ID": "<20260416200702.2374709-2-git@aaronesau.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260416200702.2374709-1-git@aaronesau.com>",
        "References": "<20260416200702.2374709-1-git@aaronesau.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2607:f8b0:4864:20::c30;\n envelope-from=aaron1esau@gmail.com; helo=mail-oo1-xc30.google.com",
        "X-Spam_score_int": "-10",
        "X-Spam_score": "-1.1",
        "X-Spam_bar": "-",
        "X-Spam_report": "(-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FORGED_GMAIL_RCVD=1,\n FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=no autolearn_force=no",
        "X-Spam_action": "no action",
        "X-Mailman-Approved-At": "Thu, 16 Apr 2026 18:38:05 -0400",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "From: Aaron Esau <aaron1esau@gmail.com>\n\nThe memmove in cmd_logs_get_log() uses cci->cel_log + get_log->offset,\nwhich performs pointer arithmetic in units of sizeof(struct cel_log)\n(4 bytes per element). However, per CXL r3.1 Section 8.2.9.5.2, the\noffset field is a byte offset into the log.\n\nThe existing bounds check correctly treats offset as a byte value:\n\n    (uint64_t)get_log->offset + get_log->length >= sizeof(cci->cel_log)\n\nBut the memmove reads from a position that is get_log->offset *\nsizeof(cel_log[0]) bytes past the start, which can be well beyond the\narray even when the bounds check passes. For example, offset=65536 and\nlength=512 passes the check (66048 < sizeof(cel_log)) but the memmove\nreads from byte 262144 past cel_log, leaking adjacent heap data.\n\nFix by casting to uint8_t * before adding the byte offset, matching the\nsemantics assumed by the bounds check.\n\nCc: qemu-stable@nongnu.org\nFixes: 056172691b (\"hw/cxl/device: Add log commands (8.2.9.4) + CEL\")\nReported-by: Aaron Esau <aaron1esau@gmail.com>\nSigned-off-by: Aaron Esau <aaron1esau@gmail.com>\n---\n hw/cxl/cxl-mailbox-utils.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c\nindex d8ba7e8625..0adf1e72c8 100644\n--- a/hw/cxl/cxl-mailbox-utils.c\n+++ b/hw/cxl/cxl-mailbox-utils.c\n@@ -1217,7 +1217,8 @@ static CXLRetCode cmd_logs_get_log(const struct cxl_cmd *cmd,\n     /* Store off everything to local variables so we can wipe out the payload */\n     *len_out = get_log->length;\n \n-    memmove(payload_out, cci->cel_log + get_log->offset, get_log->length);\n+    memmove(payload_out, (uint8_t *)cci->cel_log + get_log->offset,\n+            get_log->length);\n \n     return CXL_MBOX_SUCCESS;\n }\n",
    "prefixes": [
        "1/2"
    ]
}