get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2220116,
    "url": "http://patchwork.ozlabs.org/api/1.0/patches/2220116/?format=api",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/1.0/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": ""
    },
    "msgid": "<20260407050634.124265-1-samir@linux.ibm.com>",
    "date": "2026-04-07T05:06:34",
    "name": "[v6] hugemmap37: Migrate truncate_sigbus_versus_oom from libhugetlbfs",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "855bba70970dc8c22989410dc9488a28dd8fd090",
    "submitter": {
        "id": 91376,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/91376/?format=api",
        "name": "“Samir",
        "email": "samir@linux.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260407050634.124265-1-samir@linux.ibm.com/mbox/",
    "series": [
        {
            "id": 498845,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/498845/?format=api",
            "date": "2026-04-07T05:06:34",
            "name": "[v6] hugemmap37: Migrate truncate_sigbus_versus_oom from libhugetlbfs",
            "version": 6,
            "mbox": "http://patchwork.ozlabs.org/series/498845/mbox/"
        }
    ],
    "check": "warning",
    "checks": "http://patchwork.ozlabs.org/api/patches/2220116/checks/",
    "tags": {},
    "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=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=XebH4AdZ;\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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fq6rm3qhKz1yFt\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 06 Apr 2026 21:42:48 +1000 (AEST)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 8641D3D2279\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  6 Apr 2026 13:42:45 +0200 (CEST)",
            "from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2])\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 D87D83C2F5B\n for <ltp@lists.linux.it>; Mon,  6 Apr 2026 13:42:42 +0200 (CEST)",
            "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n [148.163.156.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-2.smtp.seeweb.it (Postfix) with ESMTPS id DC0F060013D\n for <ltp@lists.linux.it>; Mon,  6 Apr 2026 13:42:41 +0200 (CEST)",
            "from pps.filterd (m0356517.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 635NfDPh3866508; Mon, 6 Apr 2026 11:42:39 GMT",
            "from ppma21.wdc07v.mail.ibm.com\n (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4datc2pcd6-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Mon, 06 Apr 2026 11:42:39 +0000 (GMT)",
            "from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1])\n by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 636BdSFC020570;\n Mon, 6 Apr 2026 11:42:38 GMT",
            "from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226])\n by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4dbdyncf48-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Mon, 06 Apr 2026 11:42:38 +0000",
            "from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com\n [10.20.54.104])\n by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 636BgY5c52691410\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Mon, 6 Apr 2026 11:42:34 GMT",
            "from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 01BEF2004B;\n Mon,  6 Apr 2026 11:42:34 +0000 (GMT)",
            "from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 37EF720040;\n Mon,  6 Apr 2026 11:42:33 +0000 (GMT)",
            "from ltcden9-lp6.ltc.tadn.ibm.com (unknown [9.5.7.39])\n by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP;\n Mon,  6 Apr 2026 11:42:33 +0000 (GMT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n :content-transfer-encoding:date:from:message-id:mime-version\n :subject:to; s=pp1; bh=iW2bXk0Z36vCO3+y1FHBYIgPjNifSvX6x+rZ4Eg90\n /k=; b=XebH4AdZ1IoX64nX1wtbvQKj+icr51WUui06VeDElij2e2w6VCpCqymB3\n rYFd+Y5en8NjuXAOdJ8ASUceKF/cjBA8V0WWeVcaVmvTi6CD66S0YXIikLKw1IF1\n 3Hya+J42zBRSXw0TI4lM946vYMw4JumoS85LM74lVWyZI31713TqV0+zyWunYslp\n mECehFkMAx9CT9EEPUfGrqu/+vF7rKHR1iF9+PwHJySZYOR0TY9o/uEPSF5oup4z\n CqQcpPEe/uT7FRd1+ZktH84AHGAp5EYF+LpcYHY6I2l1BnhsH6m6a1UU+1wwuND3\n vtRnEYOvYylS1WyDw01gvIDrEpeSA==",
        "From": "=?utf-8?b?4oCcU2FtaXI=?= <samir@linux.ibm.com>",
        "To": "ltp@lists.linux.it",
        "Date": "Tue,  7 Apr 2026 10:36:34 +0530",
        "Message-ID": "<20260407050634.124265-1-samir@linux.ibm.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "MIME-Version": "1.0",
        "X-TM-AS-GCONF": "00",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDA2MDExMSBTYWx0ZWRfX+2xCLz5UXNPC\n EP1cd+HJ/KOwGxqRrGsJobx6pC+FnYiH0wIxqCHfxVAHduMeXW6+dRa+nxxxhiso5jjmy2H0yiv\n nyFLlS7cbNT6zwfs+tHImjGpmhATXPwca8SFIOCHat9nwqvXm3TX39WwJyk0m3Eq2FDsds38Cuy\n eUt86J7l1O7Ou0jFTAYflmsQBkqnNeN4Nu5tt75vPnT2wUq9lxXSmDc4k/xG/f/PQt8R7tsLV4r\n BS0JktmiQlA5kTeXwcI5087iDV9vVPxJwOx31EaV+gFVdvXLyVWjt19J8LfzcYo8padcrW6vIbc\n ceT7LHo1IyIQMMsUgRcXak8M6dv/hLy9FX6+IItAM6zbCiX3M1AbCgc1opTBNHeMqx33TGaN+nX\n TmWnOfbGJlwRQvXcANkJTRgudVfp6ENBMXNfw8DCO3b5tsCPFzP25lGtzc0q3QpZr6UVc6//DgX\n Afm20Th2LwqJjyAmOKQ==",
        "X-Proofpoint-GUID": "pj3fAVar4CB0OiKEVCAMZIHJgtFhbdyA",
        "X-Proofpoint-ORIG-GUID": "pj3fAVar4CB0OiKEVCAMZIHJgtFhbdyA",
        "X-Authority-Analysis": "v=2.4 cv=HJvO14tv c=1 sm=1 tr=0 ts=69d39c2f cx=c_pps\n a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17\n a=A5OVakUREuEA:10 a=M51BFTxLslgA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8\n a=VcyuwuPAi_hLocmJvkYA:9",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-06_02,2026-04-03_01,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n impostorscore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0\n malwarescore=0 spamscore=0 phishscore=0 priorityscore=1501 bulkscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2604060111",
        "X-Spam-Status": "No, score=2.6 required=7.0 tests=DATE_IN_FUTURE_12_24,\n DKIM_SIGNED,DKIM_VALID,DMARC_PASS,SPF_HELO_NONE,SPF_PASS\n shortcircuit=no autolearn=disabled version=4.0.1",
        "X-Spam-Level": "**",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-2.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-2.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH v6] hugemmap37: Migrate truncate_sigbus_versus_oom\n from libhugetlbfs",
        "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": "=?utf-8?b?4oCcU2FtaXI=?= <samir@linux.ibm.com>",
        "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": "Some kernels have a bug in the positioning of the test against\ni_size. This bug means that attempting to instantiate a page\nbeyond the end of a hugepage file can result in an OOM and SIGKILL\ninstead of the correct SIGBUS.\n\nThis test verifies that accessing memory beyond a truncated hugepage\nfile correctly triggers SIGBUS rather than causing an OOM condition.\n\nSigned-off-by: Samir <samir@linux.ibm.com>\n---\nv6:\n1. Fixed description: Removed dangling comma and improved clarity\n2. Added 'static' keyword to setup() and cleanup() functions\n3. Fixed signal handler initialization:\n   - Zero-initialized struct sigaction with = {}\n   - Added sigemptyset(&sa.sa_mask)\n   - Removed SA_SIGINFO flag (using sa_handler, not sa_sigaction)\n4. Removed dead code: Deleted unused totpages assignment from setup()\n5. Fixed resource leaks in run_test():\n   - Added SAFE_MUNMAP() for both mapped regions (p and q)\n   - Added SAFE_CLOSE() for both file descriptors (fd and fdx)\n   - Reset fd and fdx to -1 after closing\n6. Fixed cleanup() checks: Changed 'if (fd > 0)' to 'if (fd != -1)'\n7. Initialized file descriptors to -1 at declaration\n---\n runtest/hugetlb                               |   1 +\n testcases/kernel/mem/.gitignore               |   1 +\n .../kernel/mem/hugetlb/hugemmap/hugemmap37.c  | 106 ++++++++++++++++++\n 3 files changed, 108 insertions(+)\n create mode 100644 testcases/kernel/mem/hugetlb/hugemmap/hugemmap37.c",
    "diff": "diff --git a/runtest/hugetlb b/runtest/hugetlb\nindex 0896d3c94..8aaafeee3 100644\n--- a/runtest/hugetlb\n+++ b/runtest/hugetlb\n@@ -36,6 +36,7 @@ hugemmap30 hugemmap30\n hugemmap31 hugemmap31\n hugemmap32 hugemmap32\n hugemmap34 hugemmap34\n+hugemmap37 hugemmap37\n hugemmap05_1 hugemmap05 -m\n hugemmap05_2 hugemmap05 -s\n hugemmap05_3 hugemmap05 -s -m\ndiff --git a/testcases/kernel/mem/.gitignore b/testcases/kernel/mem/.gitignore\nindex b4455de51..38d428fe8 100644\n--- a/testcases/kernel/mem/.gitignore\n+++ b/testcases/kernel/mem/.gitignore\n@@ -36,6 +36,7 @@\n /hugetlb/hugemmap/hugemmap31\n /hugetlb/hugemmap/hugemmap32\n /hugetlb/hugemmap/hugemmap34\n+/hugetlb/hugemmap/hugemmap37\n /hugetlb/hugeshmat/hugeshmat01\n /hugetlb/hugeshmat/hugeshmat02\n /hugetlb/hugeshmat/hugeshmat03\ndiff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap37.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap37.c\nnew file mode 100644\nindex 000000000..06813b976\n--- /dev/null\n+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap37.c\n@@ -0,0 +1,106 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (C) 2005-2006 David Gibson & Adam Litke, IBM Corporation.\n+ */\n+\n+/*\\\n+ * Some kernels have a bug in the positioning of the test against\n+ * i_size. This bug means that attempting to instantiate a page\n+ * beyond the end of a hugepage file can result in an OOM and SIGKILL\n+ * instead of the correct SIGBUS.\n+ *\n+ * The test:\n+ * - Creates a hugepage file and maps it\n+ * - Truncates the file to 0 size\n+ * - Allocates all available hugepages to create memory pressure\n+ * - Attempts to access the mapped memory\n+ * - Verifies SIGBUS is received (correct behavior)\n+ */\n+\n+#include \"hugetlb.h\"\n+#include <setjmp.h>\n+#include <signal.h>\n+\n+#define MNTPOINT \"hugetlbfs/\"\n+static int fd = -1, fdx = -1;\n+\n+static unsigned long long hpage_size;\n+static unsigned long totpages;\n+\n+static sigjmp_buf sig_escape;\n+static volatile int test_pass;\n+\n+static void sigbus_handler(int signum LTP_ATTRIBUTE_UNUSED)\n+{\n+\ttest_pass = 1;\n+\tsiglongjmp(sig_escape, 17);\n+}\n+\n+static void run_test(void)\n+{\n+\tvoid *p, *q;\n+\tunsigned long i;\n+\n+\ttest_pass = 0;\n+\n+\tfd = tst_creat_unlinked(MNTPOINT, 0, 0600);\n+\tp = SAFE_MMAP(NULL, hpage_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);\n+\tSAFE_FTRUNCATE(fd, 0);\n+\n+\tfdx = tst_creat_unlinked(MNTPOINT, 0, 0600);\n+\ttotpages = SAFE_READ_MEMINFO(MEMINFO_HPAGE_FREE);\n+\tq = SAFE_MMAP(NULL, totpages * hpage_size, PROT_READ | PROT_WRITE, MAP_SHARED,\n+\t\t\tfdx, 0);\n+\t/* Touch the pages to ensure they're removed from the pool */\n+\tfor (i = 0; i < totpages; i++) {\n+\t\tvolatile char *x = (volatile char *)q + i * hpage_size;\n+\t\t*x = 0;\n+\t}\n+\t/* SIGBUS is what *should* happen */\n+\tSAFE_FTRUNCATE(fdx, 0);\n+\tif (sigsetjmp(sig_escape, 1) == 0)\n+\t\t*((volatile unsigned int *)p);\n+\n+\tif (test_pass)\n+\t\ttst_res(TPASS, \"Expected SIGBUS triggered\");\n+\telse\n+\t\ttst_res(TFAIL, \"Didn't SIGBUS\");\n+\n+\tSAFE_MUNMAP(p, hpage_size);\n+\tSAFE_MUNMAP(q, totpages * hpage_size);\n+\tSAFE_CLOSE(fd);\n+\tSAFE_CLOSE(fdx);\n+\tfd = -1;\n+\tfdx = -1;\n+}\n+\n+static void setup(void)\n+{\n+\tstruct sigaction sa = {};\n+\n+\tsigemptyset(&sa.sa_mask);\n+\tsa.sa_flags = 0;\n+\tsa.sa_handler = sigbus_handler;\n+\tSAFE_SIGACTION(SIGBUS, &sa, NULL);\n+\thpage_size = tst_get_hugepage_size();\n+}\n+\n+static void cleanup(void)\n+{\n+\tif (fd != -1)\n+\t\tSAFE_CLOSE(fd);\n+\tif (fdx != -1)\n+\t\tSAFE_CLOSE(fdx);\n+}\n+\n+static struct tst_test test = {\n+\t.tags = (struct tst_tag[]){{\"linux-git\", \"ebed4bfc8da8\"}, {}},\n+\t.needs_root = 1,\n+\t.mntpoint = MNTPOINT,\n+\t.needs_hugetlbfs = 1,\n+\t.needs_tmpdir = 1,\n+\t.setup = setup,\n+\t.cleanup = cleanup,\n+\t.test_all = run_test,\n+\t.hugepages = {1, TST_NEEDS},\n+};\n",
    "prefixes": [
        "v6"
    ]
}