get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228777,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228777/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260427112422.132746-1-bage@debian.org/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<20260427112422.132746-1-bage@debian.org>",
    "date": "2026-04-27T11:24:16",
    "name": "lib: libmtd: fix sign extension of ioctl request in mtd_xlock",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c9bf41382da976bc23c55f960bd35fea306d7bf9",
    "submitter": {
        "id": 84118,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/84118/?format=api",
        "name": "Bastian Germann",
        "email": "bage@debian.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260427112422.132746-1-bage@debian.org/mbox/",
    "series": [
        {
            "id": 501627,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501627/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=501627",
            "date": "2026-04-27T11:24:16",
            "name": "lib: libmtd: fix sign extension of ioctl request in mtd_xlock",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501627/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228777/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228777/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-mtd-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=ZubHJs8V;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=debian.org header.i=@debian.org header.a=rsa-sha256\n header.s=smtpauto.stravinsky header.b=OQTfxdCs;\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-mtd-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 4g41S95Pc5z1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 21:24:41 +1000 (AEST)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHK4k-0000000GnH6-0G86;\n\tMon, 27 Apr 2026 11:24:30 +0000",
            "from stravinsky.debian.org ([2001:41b8:202:deb::311:108])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHK4h-0000000GnGD-3mPM\n\tfor linux-mtd@lists.infradead.org;\n\tMon, 27 Apr 2026 11:24:28 +0000",
            "from authenticated user\n\tby stravinsky.debian.org with esmtpsa\n (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim 4.96)\n\t(envelope-from <bage@debian.org>)\n\tid 1wHK4e-005RoO-0U;\n\tMon, 27 Apr 2026 11:24:24 +0000"
        ],
        "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:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc\n\t:To: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=j1MpEGvnUfPcTAJhgmR5/sCxtlYkbY5/KU5ngVBFAgY=; b=ZubHJs8Vakn7Z8\n\tUA/oPoRm+fU4qNmeFtfqoplL9XZyL2L38hFPZW1J386PxyGl9Pr3q8ZXgSiHlURnNaYdbmO5qa5Y6\n\t7f7eP+jyCT5J3HKYi23RvKN0GmiQu3zmjkjHcwyFelcuAXsZKdNP2t3dixXUivGHyNfOpMkrchfSS\n\tf2aJe8Ga+l58YGNwtduF1F7zI++pG7ohzCSJ7CQYmcn635JkyVNIeX9/osaeqSvilviAtTUsVlEs8\n\tQntgPUw869OxzPu2fMYijq1/MmVUrIBx078wkUn0QUS0EWCEuidT5MyG2+GwFFCJ+YCIlWrRsuZhs\n\tJMokY1ar4UuHFxPbv+Xw==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org;\n\ts=smtpauto.stravinsky; h=X-Debian-User:Content-Transfer-Encoding:MIME-Version\n\t:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type:Content-ID:\n\tContent-Description:In-Reply-To:References;\n\tbh=k9+9Xcyc6Vw4VjuwsHzY/CazhicUbx2QqBvYrGBkzgQ=; b=OQTfxdCsbU891ED9n4igbB2uh/\n\tJ279dwosYlStPKrVIMhaZUH6YE8A+uLHOqY8hG/q5WAwNLOMlJ7uu1tZg64BQLJ2EwjxTsx1JvXWK\n\tl7K43Ck2Wn+qe43GoPPAIMVVc02U8sf0enf9yhsOYNZh/VbBCwnuBii04y2/FAfOm9pvZEzk+Xj8x\n\tJnw2IOWzMhi9S04sM7DUglVBQicwn1HjpksOUgAIqoc8s6qSt7xrC0JDxCd46CLos7iSD9z/Sz4M5\n\tjimLNbDVRDIntgjTAIq+vsinx7dJOo4xodyFgFh6V75DRCg4Sb+3Yv0VDgkWfoVHBunV7YdMWv5fJ\n\teBmM31Xg==;"
        ],
        "From": "Bastian Germann <bage@debian.org>",
        "To": "linux-mtd@lists.infradead.org",
        "Cc": "Bastian Germann <bage@debian.org>",
        "Subject": "[PATCH] lib: libmtd: fix sign extension of ioctl request in mtd_xlock",
        "Date": "Mon, 27 Apr 2026 13:24:16 +0200",
        "Message-ID": "<20260427112422.132746-1-bage@debian.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "MIME-Version": "1.0",
        "X-Debian-User": "bage",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260427_042427_983489_D2BA7DC0 ",
        "X-CRM114-Status": "GOOD (  10.67  )",
        "X-Spam-Score": "-4.4 (----)",
        "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:  The req parameter of mtd_xlock() was declared as int. On\n 64-bit\n    big-endian architectures such as ppc64el,\n _IOW()-derived ioctl numbers have\n    bit 31 set (because _IOC_WRITE=4 is placed at bit 29). Stori [...]\n Content analysis details:   (-4.4 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                             [2001:41b8:202:deb:0:0:311:108 listed in]\n                             [list.dnswl.org]\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n  0.0 SPF_NONE               SPF: sender does not publish an SPF Record\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay\n lines\n -0.0 DKIMWL_WL_HIGH         DKIMwl.org - High trust sender",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "The req parameter of mtd_xlock() was declared as int.  On 64-bit\nbig-endian architectures such as ppc64el, _IOW()-derived ioctl numbers\nhave bit 31 set (because _IOC_WRITE=4 is placed at bit 29).  Storing\nsuch a value in a signed int and then passing it to ioctl(), whose\nsecond argument is unsigned long, causes implicit sign extension:\n0x80084d05 becomes 0xffffffff80084d05, which does not match the\nexpected constant and fails the cmocka check_expected() assertion in\nthe unit tests for mtd_lock and mtd_unlock.\n\nFix by declaring req as unsigned long, matching the type used by the\nioctl() syscall interface.\n\nFixes: test_mtd_lock / test_mtd_unlock failures on ppc64el\nSigned-off-by: Bastian Germann <bage@debian.org>\n---\n lib/libmtd.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)",
    "diff": "diff --git a/lib/libmtd.c b/lib/libmtd.c\nindex f588e09..96a2167 100644\n--- a/lib/libmtd.c\n+++ b/lib/libmtd.c\n@@ -902,7 +902,7 @@ static int mtd_valid_erase_block(const struct mtd_dev_info *mtd, int eb)\n }\n \n static int mtd_xlock(const struct mtd_dev_info *mtd, int fd, int eb,\n-\t\t     int blocks, int req, const char *sreq)\n+\t\t     int blocks, unsigned long req, const char *sreq)\n {\n \tint ret;\n \tstruct erase_info_user ei;\n",
    "prefixes": []
}