get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217151,
    "url": "http://patchwork.ozlabs.org/api/patches/2217151/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327174701.364328-1-pbonzini@redhat.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": "<20260327174701.364328-1-pbonzini@redhat.com>",
    "list_archive_url": null,
    "date": "2026-03-27T17:47:01",
    "name": "hpet: fix bounds check for s->timer[]",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d54819f752e5fb408c487584bc087acc085011a0",
    "submitter": {
        "id": 2701,
        "url": "http://patchwork.ozlabs.org/api/people/2701/?format=api",
        "name": "Paolo Bonzini",
        "email": "pbonzini@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327174701.364328-1-pbonzini@redhat.com/mbox/",
    "series": [
        {
            "id": 497812,
            "url": "http://patchwork.ozlabs.org/api/series/497812/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=497812",
            "date": "2026-03-27T17:47:01",
            "name": "hpet: fix bounds check for s->timer[]",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497812/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217151/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217151/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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=CpeKwy1W;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=rCUdbCQK;\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=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.gnu.org (lists.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 4fj7Qs31slz1y1P\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 04:48:05 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w6BHJ-0003oV-6v; Fri, 27 Mar 2026 13:47:27 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1w6BH7-0003ns-1p\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 13:47:16 -0400",
            "from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1w6BH4-0005fD-6r\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 13:47:11 -0400",
            "from mail-wr1-f71.google.com (mail-wr1-f71.google.com\n [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-120-LQ533YzCOWKEVpZ9c_IFVA-1; Fri, 27 Mar 2026 13:47:06 -0400",
            "by mail-wr1-f71.google.com with SMTP id\n ffacd0b85a97d-43b95f9f837so2092345f8f.0\n for <qemu-devel@nongnu.org>; Fri, 27 Mar 2026 10:47:06 -0700 (PDT)",
            "from [192.168.10.48] ([151.49.85.67])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43b91942f24sm17268571f8f.11.2026.03.27.10.47.02\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 27 Mar 2026 10:47:02 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1774633627;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=5fKt7A2FD1i1SFTtrZ6g0b8Qc8madY+JGGQ0SAw4LSg=;\n b=CpeKwy1Wr/AbWEO74xrM0GbVG0T3CA76undHzBdOxuY7b+s21priIRGmsLT247e7lHN61Q\n YresUbtW7qfmPZzzFuSv+FzBJX2I3T3J1xXS0OhBg5ZKjcnlaAg6w7T3wu/ziDGYqQd7pk\n bPW4R4pBJPDJqCNFBeYrWVUCqV8XTPE=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1774633624; x=1775238424; darn=nongnu.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=5fKt7A2FD1i1SFTtrZ6g0b8Qc8madY+JGGQ0SAw4LSg=;\n b=rCUdbCQKrFFnGOdtCoHpSoiy5o2MwYuo2+6Hy0GSJkPKCWe/8A2f7kj1SRet563NuG\n EMtCrIKsp8sEj13OQaymke/fNrCeiDJ7FbjV9+t8b0fKfpkKjkv08gn+yDmp/vGKf/7a\n pP5dJ89aZJrugXu21QZaBwNKgqI2LniWgjZknX2XCFprOv1Q3tdR+VEXfASh3RjBmP+k\n 7VE+IYi4zE/tNzM6fJ9ESKsww4n9Kq5S291gctwsN+Z/A4gnX6lMKjLtrmsHv2udwnLh\n a6vekSGKuFAhmJDl9pWRca05VXBzkXrN4peupLXtu2cwtvJ9dGRT5IQbuXayucvHp2nF\n iyAg=="
        ],
        "X-MC-Unique": "LQ533YzCOWKEVpZ9c_IFVA-1",
        "X-Mimecast-MFC-AGG-ID": "LQ533YzCOWKEVpZ9c_IFVA_1774633625",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774633624; x=1775238424;\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=5fKt7A2FD1i1SFTtrZ6g0b8Qc8madY+JGGQ0SAw4LSg=;\n b=VF+0CTFdfT8B8N/dIh/tJBZD3xwCyL06a9QeFb1diT3EfpjKgBLzyVyW0JN1rYsaJL\n HOY3TA7n6kwnNcuvzuINEMKFZb+tz/XV5lS3Py9KSTs7J4NmaDVPdro0riZ+Q4t8CsSR\n M5at6wGiQRDFLRfI22Vn3FX0U63+L2zOotIDGLo8XIguYzA+MnHMzdoz1uEB8OpcxMsw\n hWfvhll+8jluBLU8HZxve0Tbq5xXOqL90op1El/Jg/UqbstwgmIGjNHY6izLCPa5/Mo1\n NbCXcm+myccQZcJGWf5m0xuw2jNNt955lBOCE9OsqR6m2YIXfvKtapH0TbBMOaw2qFJf\n IebA==",
        "X-Gm-Message-State": "AOJu0YxHJe0NztoDUy/U7CNUo5j6B1RMhyVRQipetQgd/WPdiGoYW+VP\n GrmzaPBlrLPzUYlcBLHb8n5jEb6r4blY2hDTPBnkJtdv3uXIF9o0c1VbdrC0xKyNtjB6udRA75x\n j9vdUtXTz3wKphGyv2hgPO+D9RxziD4UVMApG+MDor5Ouls9MxOoGGcEuQwDYR/VBIHyvCZPfMt\n jnZPlZJFW9tcAI/4UNbQfTLw/JyfeLBmPDdBthRy/U",
        "X-Gm-Gg": "ATEYQzw0CnGv8ulQLQBg5rxivVdsee17XcuqCqM3Pg5oeGXvy70tVwidnzlXdooFPYL\n J/M+fTlCHD5wjm12LoVHLHFHYuxHUtHWHSW4c4BoqZlmFrhsUQYBJ+iordxxagZWa0aet/ioAzI\n ozY8GbQbTFgPpclVtlGL+I9BDwW+bU5PsPYoe03Xbkg9jZ4IvmlGsgE9ZHnfpdpUxdApq24Gxac\n YsS9pGEfrYHl1masx9MFZGZ+r3ZA/62ktQc7DZiYQ338Hzq9x1mjMYKEk0PlTCLkrB1r2M92jsx\n RaZqHEGS9zlNkoKiG9VuyYokflOdllgPox5TanUP6rFpmtSyuRoQvu5aaW1LYYyRXyePRF6Tw6r\n NsqxKSwToHgF4mLlaELxWJD/DHjr8NyvK+5GCihSb3+QiS4zxth8oDjy+d6joSFAQ23iuwJmQe8\n h0Vd2PmirsmIrDAlAmQSGTfOgz",
        "X-Received": [
            "by 2002:a05:600c:810a:b0:487:2e8:69c5 with SMTP id\n 5b1f17b1804b1-48727e909b0mr52629385e9.15.1774633624206;\n Fri, 27 Mar 2026 10:47:04 -0700 (PDT)",
            "by 2002:a05:600c:810a:b0:487:2e8:69c5 with SMTP id\n 5b1f17b1804b1-48727e909b0mr52628785e9.15.1774633623615;\n Fri, 27 Mar 2026 10:47:03 -0700 (PDT)"
        ],
        "From": "Paolo Bonzini <pbonzini@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Zhao Liu <zhao1.liu@intel.com>,\n \"Yuma Kurogome, Ricerca Security, Inc.\" <yumak@ricsec.co.jp>",
        "Subject": "[PATCH] hpet: fix bounds check for s->timer[]",
        "Date": "Fri, 27 Mar 2026 18:47:01 +0100",
        "Message-ID": "<20260327174701.364328-1-pbonzini@redhat.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=170.10.133.124;\n envelope-from=pbonzini@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "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": "Fix an off-by-one issue in QEMU's HPET read and write MMIO handlers.\nBoth handlers check timer_id > s->num_timers instead of timer_id >=\ns->num_timers, allowing a guest to access one timer beyond the valid\nrange.\n\nThe affected slot is initialized properly in hpet_realize, which goes\nthrough all HPET_MAX_TIMERS elements of the array, so even though\nit is not reset in hpet_reset() the bug does not cause any use of\nuninitialized host memory.  Because of this, and also because (even\nthough HPET_MAX_TIMERS is 32) the HPET only has room for 24 timers in\nits MMIO region, the bug has no security implications.\n\nCommit 869b0afa4fa (\"rust/hpet: Drop BqlCell wrapper for num_timers\",\n2025-06-06) silently fixed the same bug in rust/hw/timer/hpet/src/device.rs.\n\nReported-by: Yuma Kurogome, Ricerca Security, Inc. <yumak@ricsec.co.jp>\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n hw/timer/hpet.c | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c\nindex 767093c431a..42285cff762 100644\n--- a/hw/timer/hpet.c\n+++ b/hw/timer/hpet.c\n@@ -464,13 +464,14 @@ static uint64_t hpet_ram_read(void *opaque, hwaddr addr,\n         }\n     } else {\n         uint8_t timer_id = (addr - 0x100) / 0x20;\n-        HPETTimer *timer = &s->timer[timer_id];\n+        HPETTimer *timer;\n \n-        if (timer_id > s->num_timers) {\n+        if (timer_id >= s->num_timers) {\n             trace_hpet_timer_id_out_of_range(timer_id);\n             return 0;\n         }\n \n+        timer = &s->timer[timer_id];\n         switch (addr & 0x1f) {\n         case HPET_TN_CFG: // including interrupt capabilities\n             return timer->config >> shift;\n@@ -564,13 +565,15 @@ static void hpet_ram_write(void *opaque, hwaddr addr,\n         }\n     } else {\n         uint8_t timer_id = (addr - 0x100) / 0x20;\n-        HPETTimer *timer = &s->timer[timer_id];\n+        HPETTimer *timer;\n \n         trace_hpet_ram_write_timer_id(timer_id);\n-        if (timer_id > s->num_timers) {\n+        if (timer_id >= s->num_timers) {\n             trace_hpet_timer_id_out_of_range(timer_id);\n             return;\n         }\n+\n+        timer = &s->timer[timer_id];\n         switch (addr & 0x18) {\n         case HPET_TN_CFG:\n             trace_hpet_ram_write_tn_cfg(addr & 4);\n",
    "prefixes": []
}