get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2219502,
    "url": "http://patchwork.ozlabs.org/api/patches/2219502/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-arc/patch/20260403161002.2-arc-dt-cpumap-pengpeng@iscas.ac.cn/",
    "project": {
        "id": 48,
        "url": "http://patchwork.ozlabs.org/api/projects/48/?format=api",
        "name": "Linux ARC development",
        "link_name": "linux-arc",
        "list_id": "linux-snps-arc.lists.infradead.org",
        "list_email": "linux-snps-arc@lists.infradead.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260403161002.2-arc-dt-cpumap-pengpeng@iscas.ac.cn>",
    "list_archive_url": null,
    "date": "2026-04-03T05:41:47",
    "name": "arc: validate DT CPU map strings before parsing them",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "af4949a84dd0e756c021549fbdb8b8e2bffdf929",
    "submitter": {
        "id": 93000,
        "url": "http://patchwork.ozlabs.org/api/people/93000/?format=api",
        "name": "Pengpeng Hou",
        "email": "pengpeng@iscas.ac.cn"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-arc/patch/20260403161002.2-arc-dt-cpumap-pengpeng@iscas.ac.cn/mbox/",
    "series": [
        {
            "id": 498592,
            "url": "http://patchwork.ozlabs.org/api/series/498592/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-arc/list/?series=498592",
            "date": "2026-04-03T05:41:47",
            "name": "arc: validate DT CPU map strings before parsing them",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498592/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2219502/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2219502/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.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 secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=3g1xVfxw;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\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 4fn79R2GZ0z1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 16:50:15 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w8XQ1-00000001Ldl-0ZBg;\n\tFri, 03 Apr 2026 05:50:09 +0000",
            "from smtp81.cstnet.cn ([159.226.251.81] helo=cstnet.cn)\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w8XPy-00000001Lcs-38Hz\n\tfor linux-snps-arc@lists.infradead.org;\n\tFri, 03 Apr 2026 05:50:08 +0000",
            "from 0002-arc.eml (unknown [111.196.245.197])\n\tby APP-03 (Coremail) with SMTP id rQCowAA3WuELVc9pL4m7DA--.13684S2;\n\tFri, 03 Apr 2026 13:50:03 +0800 (CST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help:\n\tList-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Cc:To:Message-ID:Date\n\t:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=332M6LK+QuUQ17GPXPvvxqosOSsPyBDZsF/BsIrwUP4=; b=3g1xVfxwm/q6sI\n\t8wqaQA9mJ2wsI59dHychwsigVx8K+EBzdU+K6kg1LSqg5j8tac2XvfWQ4oK/afu3kb1y10AQ1htKs\n\t/wiIIHQ01HJxFKUjCH/DkADRifIBu821L8Yzepxoays96TLjbzD1slfyQZzmVRte2BQwr/HJa6Qsk\n\tCbppmqGiUz2M5DEdDM3tXnsigR3k96amPBxrhSGnL2SKrMbOCEfqSK3VSJfvbP5BgPo2pcDudVPoR\n\tTJzcBnxvINURhQzO1GWbTxkLFqXhY3H721ZDoTh7X2n3twikpaPwo4F/q/TkjNyzG+X9NvULMaHZ1\n\t3pf2+FyGEi/mj29E3noA==;",
        "From": "Pengpeng Hou <pengpeng@iscas.ac.cn>",
        "Date": "Fri, 3 Apr 2026 13:41:47 +0800",
        "Message-ID": "<20260403161002.2-arc-dt-cpumap-pengpeng@iscas.ac.cn>",
        "To": "Vineet Gupta <vgupta@kernel.org>",
        "Cc": "linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,\n pengpeng@iscas.ac.cn",
        "Subject": "[PATCH] arc: validate DT CPU map strings before parsing them",
        "X-CM-TRANSID": "rQCowAA3WuELVc9pL4m7DA--.13684S2",
        "X-Coremail-Antispam": "1UD129KBjvJXoW7AFy3uryUtF1xWF47Cw1xZrb_yoW8Gr13pF\n\tZ09FyqqrZ0v3s7A34qyr1kua4Ykw1kJr129FWrGw47Zw47tryDXrZa9F1v9r1xArW09a4F\n\tkFZ8uF4qyr4UJaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDU0xBIdaVrnRJUUUya14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0\n\trVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02\n\t1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j\n\t6F4UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s\n\t0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII\n\tjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr\n\t1lF7xvr2IY64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMxC2\n\t0s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI\n\t0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE\n\t14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20x\n\tvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8\n\tJVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbnmRUUUUUU==",
        "X-Originating-IP": "[111.196.245.197]",
        "X-CM-SenderInfo": "pshqw1xhqjqxpvfd2hldfou0/",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260402_225007_207653_900B4016 ",
        "X-CRM114-Status": "UNSURE (   7.26  )",
        "X-CRM114-Notice": "Please train this message.",
        "X-Spam-Score": "-4.2 (----)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  arc_get_cpu_map() fetches the possible-cpus or present-cpus\n    property from the flat DT and immediately passes the raw pointer to\n cpulist_parse().\n    That parser expects a NUL-terminated text buffer, but t [...]\n Content analysis details:   (-4.2 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,\n                             medium trust\n                             [159.226.251.81 listed in list.dnswl.org]\n  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                             [159.226.251.81 listed in sa-accredit.habeas.com]\n  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The\n                             query to Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                         [159.226.251.81 listed in\n sa-trusted.bondedsender.org]\n -0.0 SPF_PASS               SPF: sender matches SPF record\n -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                            [159.226.251.81 listed in\n bl.score.senderscore.com]",
        "X-BeenThere": "linux-snps-arc@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "Linux on Synopsys ARC Processors <linux-snps-arc.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-snps-arc>,\n <mailto:linux-snps-arc-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-snps-arc/>",
        "List-Post": "<mailto:linux-snps-arc@lists.infradead.org>",
        "List-Help": "<mailto:linux-snps-arc-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-snps-arc>,\n <mailto:linux-snps-arc-request@lists.infradead.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-snps-arc\" <linux-snps-arc-bounces@lists.infradead.org>",
        "Errors-To": "\n linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "arc_get_cpu_map() fetches the possible-cpus or present-cpus property\nfrom the flat DT and immediately passes the raw pointer to\ncpulist_parse(). That parser expects a NUL-terminated text buffer, but\nthis path does not prove that the DT property is terminated within its\ndeclared bounds.\n\nReject unterminated CPU-map properties before handing them to\ncpulist_parse().\n\nSigned-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>\n---\n arch/arc/kernel/smp.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c\nindex b2f2c59279a6..e0f8218e9172 100644\n--- a/arch/arc/kernel/smp.c\n+++ b/arch/arc/kernel/smp.c\n@@ -22,6 +22,7 @@\n #include <linux/irqdomain.h>\n #include <linux/export.h>\n #include <linux/of_fdt.h>\n+#include <linux/string.h>\n \n #include <asm/mach_desc.h>\n #include <asm/setup.h>\n@@ -43,11 +44,15 @@ static int __init arc_get_cpu_map(const char *name, struct cpumask *cpumask)\n {\n \tunsigned long dt_root = of_get_flat_dt_root();\n \tconst char *buf;\n+\tint len;\n \n-\tbuf = of_get_flat_dt_prop(dt_root, name, NULL);\n+\tbuf = of_get_flat_dt_prop(dt_root, name, &len);\n \tif (!buf)\n \t\treturn -EINVAL;\n \n+\tif (!memchr(buf, '\\0', len))\n+\t\treturn -EINVAL;\n+\n \tif (cpulist_parse(buf, cpumask))\n \t\treturn -EINVAL;\n \n",
    "prefixes": []
}