get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217007,
    "url": "http://patchwork.ozlabs.org/api/patches/2217007/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260327140310.2306-1-always.starving0@gmail.com/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/projects/59/?format=api",
        "name": "Linux Test Project development",
        "link_name": "ltp",
        "list_id": "ltp.lists.linux.it",
        "list_email": "ltp@lists.linux.it",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260327140310.2306-1-always.starving0@gmail.com>",
    "list_archive_url": null,
    "date": "2026-03-27T14:03:08",
    "name": "[v6] open: fix cleanup condition and use snprintf",
    "commit_ref": null,
    "pull_url": null,
    "state": "under-review",
    "archived": false,
    "hash": "0716519a507dacdbeb3b8831888e2036a95c1692",
    "submitter": {
        "id": 92589,
        "url": "http://patchwork.ozlabs.org/api/people/92589/?format=api",
        "name": "Jinseok Kim",
        "email": "always.starving0@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260327140310.2306-1-always.starving0@gmail.com/mbox/",
    "series": [
        {
            "id": 497774,
            "url": "http://patchwork.ozlabs.org/api/series/497774/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=497774",
            "date": "2026-03-27T14:03:08",
            "name": "[v6] open: fix cleanup condition and use snprintf",
            "version": 6,
            "mbox": "http://patchwork.ozlabs.org/series/497774/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217007/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217007/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ltp@lists.linux.it"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ltp@picard.linux.it"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=QDzHExWn;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\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 4fj2S01FK1z1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 01:03:44 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id BA1173CFF95\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 15:03:41 +0100 (CET)",
            "from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 9F4713C9D7D\n for <ltp@lists.linux.it>; Fri, 27 Mar 2026 15:03:38 +0100 (CET)",
            "from mail-pl1-x644.google.com (mail-pl1-x644.google.com\n [IPv6:2607:f8b0:4864:20::644])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 13E16600931\n for <ltp@lists.linux.it>; Fri, 27 Mar 2026 15:03:38 +0100 (CET)",
            "by mail-pl1-x644.google.com with SMTP id\n d9443c01a7336-2b0c30b517aso7675075ad.3\n for <ltp@lists.linux.it>; Fri, 27 Mar 2026 07:03:37 -0700 (PDT)",
            "from localhost.localdomain ([59.16.109.172])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b0bc76f184sm62962985ad.9.2026.03.27.07.03.34\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 27 Mar 2026 07:03:35 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1774620216; x=1775225016; darn=lists.linux.it;\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=UjTYF6LKYAlN40yyvc1arnmsH3RA1D0DccsM+x3aZPE=;\n b=QDzHExWnF5QYnw0XSbmCUA+TBwLTMwvSJsU2JCEmxH43gtXHQJoifIsrW16q8kWiRw\n suHprm6BjTMKXGxTvyMBzNEAL0g/lsTikLk+aalH5y6WoaoVFXbb+jz9Gr2wiX1y58Z8\n Nt8Yojq5I4VfxJYEjBcwwT0jm42DwA7/sRKSMhRYri5oiGb+vwIWOjF3wpPaE7UUvBK6\n 9LPz5zSpW+2fnO+L9+9LM/FoIYVibC3UDCbFZG9QYz6S59Tqlhkes1orS4Y2rOY5lB7l\n 32ocjp/4zAC8gede953w56x9lHSILU5nQ1A2Djkg3jHLe0k7ewXCIpEGH6nWhPO29G64\n tYFA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774620216; x=1775225016;\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=UjTYF6LKYAlN40yyvc1arnmsH3RA1D0DccsM+x3aZPE=;\n b=ijFlfLnG+0gIZ5FdA0nyvqN9hj6p36CqRQLdg/5P2Qjcw4vKyVEfum2Hn9NRmfewtx\n ez+d4UP/rhd/sPPagmg2FUZrOvoAGzMqT208/iKDr6NEx3e/LvZImFJIU8jUiIEnJcct\n EN+VhHAT5UH04F2LxmcI3ds8M2D+d7SYpxmrUN98RDkHL+nwfsStPcijRJ5n28/HRURO\n HbI2tUIRhnEPfEjbsx1jQvyTtKVXlOkete9hdn/1fo+MHiQw15mF7AF4gbL67YJ9C+Hh\n bee3YKdbE+vos8yyPMJjclaWmawUEZpfcvf6m3RyV4pQWbQCV5HPQ48MLRhyeemA2MXx\n WThA==",
        "X-Gm-Message-State": "AOJu0Ywo1qYO6mR6lcUSoDD3fEjZau5KEcXrAZIhqsivOhVqyLZrFHw1\n PqRrdcMMtLpdpbwzleJzTDGJILRp87WgXVEbjuLttXLNID/ApvmJFmQlw7Nu6b/0Uw==",
        "X-Gm-Gg": "ATEYQzyOzyjUgTpnDqqPebsiyej+pIUHFw3dN1/eGvIgqrPJHOIoVZV+UBlh41gJQzW\n gIUxBlYQbKeQ6lbyBQRhxgNxQgw1nHxN1hhZUkiVdYZvqogsOVlY1if3tQWZpADUtD1pWkILa0R\n q/h8avkNstDV3Vrmm4eIDfiwkiRqdU+9FkkW7OBpAF4S7HtkYwYwx1xofC8yi76G8I3Xcm2wUTW\n iwc1Cm3pO+o+scxRX1D7aBPYu+3EAaEEL2cVlgCkQdLc6Bza7JAoorQzkUFl7GttmyGujtQZ1IU\n 0Bbm5og4SJkXsyOi3W4bAqvlnQeR4mStfM3XAipF/fX5L6ckB319RXxSZZk92Hqqc01xsqO6ZG5\n KanNKC8xbpkX6sPYvF8D1YToxPlIVC8BLAucArB1waAEbBcBrVGPW8xctSPoCC/GRlsvMLwWrvY\n fT4R6R79t0uI0Mgg+GlK+8UhbFTFwoY9ZzdQ18p8ul/A==",
        "X-Received": "by 2002:a17:902:d584:b0:2ae:572a:9f19 with SMTP id\n d9443c01a7336-2b0cdcb9f86mr28829275ad.21.1774620216258;\n Fri, 27 Mar 2026 07:03:36 -0700 (PDT)",
        "From": "Jinseok Kim <always.starving0@gmail.com>",
        "To": "andrea.cervesato@suse.com",
        "Date": "Fri, 27 Mar 2026 23:03:08 +0900",
        "Message-ID": "<20260327140310.2306-1-always.starving0@gmail.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<69c403b7.050a0220.1389b1.789b@mx.google.com>",
        "References": "<69c403b7.050a0220.1389b1.789b@mx.google.com>",
        "MIME-Version": "1.0",
        "X-Spam-Status": "No, score=0.3 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,\n SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-5.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH v6] open: fix cleanup condition and use snprintf",
        "X-BeenThere": "ltp@lists.linux.it",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Linux Test Project <ltp.lists.linux.it>",
        "List-Unsubscribe": "<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>",
        "List-Archive": "<http://lists.linux.it/pipermail/ltp/>",
        "List-Post": "<mailto:ltp@lists.linux.it>",
        "List-Help": "<mailto:ltp-request@lists.linux.it?subject=help>",
        "List-Subscribe": "<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>",
        "Cc": "ltp@lists.linux.it",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it",
        "Sender": "\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"
    },
    "content": "Replace sprintf() with snprintf() for safer string handling.\n\nThe cleanup logic checked '!first' to decide whether to close file\ndescriptors. Since file descriptor 0 is valid, this may incorrectly\nskip cleanup and leak descriptors.\n\nAlso initialize \"first\" to -1 and set the fds array to -1 after\nallocation. Skip such entries in cleanup() to avoid calling SAFE_CLOSE()\non invalid file descriptors.\n\nSigned-off-by: Jinseok Kim <always.starving0@gmail.com>\n---\n testcases/kernel/syscalls/open/open04.c | 26 ++++++++++++++-----------\n 1 file changed, 15 insertions(+), 11 deletions(-)\n\n--\n2.43.0",
    "diff": "diff --git a/testcases/kernel/syscalls/open/open04.c b/testcases/kernel/syscalls/open/open04.c\nindex 7573af1c8..6ec18cbfa 100644\n--- a/testcases/kernel/syscalls/open/open04.c\n+++ b/testcases/kernel/syscalls/open/open04.c\n@@ -15,9 +15,10 @@\n\n #define FNAME \"open04\"\n\n-static int fds_limit, first, i;\n+static int fds_limit;\n+static int first = -1;\n static int *fds;\n-static char fname[20];\n+static char fname[PATH_MAX];\n\n static void setup(void)\n {\n@@ -29,10 +30,11 @@ static void setup(void)\n \tfirst = SAFE_OPEN(FNAME, O_RDWR | O_CREAT, 0777);\n\n \tfds = SAFE_MALLOC(sizeof(int) * (fds_limit - first));\n+\tmemset(fds, -1, sizeof(int) * (fds_limit - first));\n \tfds[0] = first;\n\n-\tfor (i = first + 1; i < fds_limit; i++) {\n-\t\tsprintf(fname, FNAME \".%d\", i);\n+\tfor (int i = first + 1; i < fds_limit; i++) {\n+\t\tsnprintf(fname, sizeof(fname), FNAME \".%d\", i);\n \t\tfd = open(fname, O_RDWR | O_CREAT, 0777);\n \t\tif (fd == -1) {\n \t\t\tif (errno != EMFILE)\n@@ -46,20 +48,22 @@ static void setup(void)\n\n static void run(void)\n {\n-\tsprintf(fname, FNAME \".%d\", fds_limit);\n+\tsnprintf(fname, sizeof(fname), FNAME \".%d\", fds_limit);\n \tTST_EXP_FAIL2(open(fname, O_RDWR | O_CREAT, 0777), EMFILE);\n }\n\n static void cleanup(void)\n {\n-\tif (!first || !fds)\n-\t\treturn;\n+\tif (first >= 0 && fds) {\n+\t\tint limit = fds_limit - first;\n\n-\tfor (i = first; i < fds_limit; i++)\n-\t\tSAFE_CLOSE(fds[i - first]);\n+\t\tfor (int i = 0; i < limit; i++) {\n+\t\t\tif (fds[i] != -1)\n+\t\t\t\tSAFE_CLOSE(fds[i]);\n+\t\t}\n+\t}\n\n-\tif (fds)\n-\t\tfree(fds);\n+\tfree(fds);\n }\n\n static struct tst_test test = {\n",
    "prefixes": [
        "v6"
    ]
}