get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2219824,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2219824/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260404152742.1664783-1-pavrampu@linux.ibm.com/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260404152742.1664783-1-pavrampu@linux.ibm.com>",
    "list_archive_url": null,
    "date": "2026-04-04T15:27:42",
    "name": "hugemmap37: migrated task-size-overrun.c from libhugetlbfs v4",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "dff03ebaa56a1a60ba443a4f19bbf8ce93977a7f",
    "submitter": {
        "id": 91766,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/91766/?format=api",
        "name": "Pavithra",
        "email": "pavrampu@linux.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260404152742.1664783-1-pavrampu@linux.ibm.com/mbox/",
    "series": [
        {
            "id": 498735,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/498735/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=498735",
            "date": "2026-04-04T15:27:42",
            "name": "hugemmap37: migrated task-size-overrun.c from libhugetlbfs v4",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498735/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2219824/comments/",
    "check": "warning",
    "checks": "http://patchwork.ozlabs.org/api/patches/2219824/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=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=W/Z4hAFa;\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 4fnzxb5Z79z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 02:28:02 +1100 (AEDT)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id B1F383E13A0\n\tfor <incoming@patchwork.ozlabs.org>; Sat,  4 Apr 2026 17:27:59 +0200 (CEST)",
            "from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 546E73D9008\n for <ltp@lists.linux.it>; Sat,  4 Apr 2026 17:27:54 +0200 (CEST)",
            "from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n [148.163.158.5])\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-7.smtp.seeweb.it (Postfix) with ESMTPS id D917A2000E8\n for <ltp@lists.linux.it>; Sat,  4 Apr 2026 17:27:53 +0200 (CEST)",
            "from pps.filterd (m0356516.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 634DobPF100366; Sat, 4 Apr 2026 15:27:52 GMT",
            "from ppma12.dal12v.mail.ibm.com\n (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dar2g9dy1-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Sat, 04 Apr 2026 15:27:51 +0000 (GMT)",
            "from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1])\n by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 634EqlBN021631;\n Sat, 4 Apr 2026 15:27:51 GMT",
            "from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225])\n by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4d6sat1vd7-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Sat, 04 Apr 2026 15:27:50 +0000",
            "from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com\n [10.20.54.100])\n by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 634FRl8I39846182\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Sat, 4 Apr 2026 15:27:47 GMT",
            "from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 2516E20043;\n Sat,  4 Apr 2026 15:27:47 +0000 (GMT)",
            "from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 0C57520040;\n Sat,  4 Apr 2026 15:27:46 +0000 (GMT)",
            "from li-49acbccc-2994-11b2-a85c-d51b89e344f1.ibm.com.com (unknown\n [9.39.20.67]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP;\n Sat,  4 Apr 2026 15:27:45 +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=Lm+dkZoxz1lVxKoDalop92Jx2p9RMt3Zbe7/oU84A\n WA=; b=W/Z4hAFayogWmhgccUPhEeG97grg+1UZDfMcIKIr4+guYWZrVCz6BSULe\n 4G3OVd32ZBcW0LFaSn+OdBCf5zlbDalzqg73INxKbnddp18/np9vT/dGs26B82xW\n lXM3SEbvhHJq3M4RYZE64HlqebLxWw4gJ5a64Jafcl08saJgG5MOk0nGmlGii8u3\n zux6mGP2OvbZp02YSqJzFGHorVO9CfRmD9wupRBSbiiHSkfgGHe81eU21plmnRGF\n SC0KwimFTOU3dC8j8suxw5Q/JNP3iUBBJmMdmtrhimkNvvbs4GznNtaeRjwSkQ47\n 7ky3hS9X+uZa1N4We3Kv+PmdXiUsw==",
        "From": "Pavithra <pavrampu@linux.ibm.com>",
        "To": "ltp@lists.linux.it",
        "Date": "Sat,  4 Apr 2026 20:57:42 +0530",
        "Message-ID": "<20260404152742.1664783-1-pavrampu@linux.ibm.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "MIME-Version": "1.0",
        "X-TM-AS-GCONF": "00",
        "X-Proofpoint-GUID": "wt3xWynKW1yuE3xLlOihm0jTZn7439YA",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDA0MDE0NCBTYWx0ZWRfX+Daf4M26WsUf\n StoiP7xTznnYYRwy+C6pIiqIa4IS3c3YSpjI/OOqjxx0noKcnaz4ydynTTsxae6lWkIQkUQPz7Z\n 8lihXf7f7WknE0VxiYHmdvZsWBzt1l51TvPQuvV7JWwmvEqAOI5IhtXnFPMl2m++mKVFXChTxD3\n /CuDL0T04IjDjmY+lpViEW3iwNFM5jpNnxiUAcV+9CBbE8Hgeu11DIztzKFg57yV4euaYrxD5Cd\n wfbiJDg3wsg3HMf9sNMTvvSMKz5MGseM/K5wrvEqgROyklilRttrbC/+yqsEZP/yv6mfImu/ky+\n xEgkA341TOk0NZbblFH6ECVVvfJiq1ximYvpXe0n2XIfZCqlRYvvUShDp4pTYtoc6G1j8kO+GLE\n NNkJzvKu0n1j57dhwI6cgZ1cJTKo5/U9ITvsCc6pcG685aC/XEXeQcphJljJ/OKu7hmIjjFmRsA\n G/5O0a59qRtAOK/pwag==",
        "X-Authority-Analysis": "v=2.4 cv=b+u/I9Gx c=1 sm=1 tr=0 ts=69d12df7 cx=c_pps\n a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=Y2IxJ9c9Rs8Kov3niI8_:22 a=mPJGfP9KAAAA:20 a=VnNF1IyMAAAA:8\n a=-KeBFjgWKjnupdVGQNEA:9 a=bA3UWDv6hWIuX7UZL3qL:22",
        "X-Proofpoint-ORIG-GUID": "wt3xWynKW1yuE3xLlOihm0jTZn7439YA",
        "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-04_02,2026-04-03_01,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0\n impostorscore=0 malwarescore=0 spamscore=0 priorityscore=1501 clxscore=1015\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2604040144",
        "X-Spam-Status": "No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\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-7.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-7.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH] hugemmap37: migrated task-size-overrun.c from\n libhugetlbfs v4",
        "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": "pavrampu@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": "This test verifies that the kernel correctly prevents mmap operations\nfrom creating mappings that straddle the TASK_SIZE boundary when using\nhugepages. Such mappings could lead to undefined behavior or security\nissues if allowed.\n\nSigned-off-by: Pavithra <pavrampu@linux.ibm.com>\n---\n runtest/hugetlb                               |   1 +\n testcases/kernel/mem/.gitignore               |   1 +\n .../kernel/mem/hugetlb/hugemmap/hugemmap37.c  | 164 ++++++++++++++++++\n 3 files changed, 166 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..9a9d45de5\n--- /dev/null\n+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap37.c\n@@ -0,0 +1,164 @@\n+// SPDX-License-Identifier: LGPL-2.1-or-later\n+/*\n+ * Copyright (C) 2005-2006 David Gibson & Adam Litke, IBM Corporation.\n+ * Copyright (c) 2026 Pavithra <pavrampu@linux.ibm.com>\n+ */\n+\n+/*\n+ * Origin: https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/task-size-overrun.c\n+ *\n+ * This test verifies the behavior of mmap across the TASK_SIZE boundary.\n+ * It checks whether mmap with and without MAP_FIXED correctly handles\n+ * mappings that straddle the TASK_SIZE boundary.\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <unistd.h>\n+#include <sys/mman.h>\n+#include <errno.h>\n+\n+#include \"hugetlb.h\"\n+#include \"tst_test.h\"\n+#include \"tst_safe_stdio.h\"\n+#include \"tst_safe_macros.h\"\n+\n+#define MAPS_BUF_SZ 4096\n+#define MNTPOINT \"hugetlbfs/\"\n+\n+static long hpage_size;\n+static int fd = -1;\n+\n+static unsigned long find_last_mapped(void)\n+{\n+\tchar line[MAPS_BUF_SZ];\n+\tunsigned long start, end, off, ino;\n+\tFILE *f;\n+\tint found = 0;\n+\n+\tf = SAFE_FOPEN(\"/proc/self/maps\", \"r\");\n+\n+\t/* Read all lines and keep the last non-special mapping */\n+\twhile (fgets(line, MAPS_BUF_SZ, f)) {\n+\t\t/* Skip special mappings like [vsyscall], [vdso], [vvar] */\n+\t\tif (strstr(line, \"[vsyscall]\") || strstr(line, \"[vdso]\") ||\n+\t\t    strstr(line, \"[vvar]\"))\n+\t\t\tcontinue;\n+\n+\t\tfound = 1;\n+\t}\n+\n+\tSAFE_FCLOSE(f);\n+\n+\tif (!found)\n+\t\ttst_brk(TBROK, \"Could not find any valid mapping in /proc/self/maps\");\n+\n+\ttst_res(TINFO, \"Last map: %s\", line);\n+\tif (sscanf(line, \"%lx-%lx %*s %lx %*s %ld\", &start, &end, &off, &ino) != 4)\n+\t\ttst_brk(TBROK, \"Failed to parse /proc/self/maps line\");\n+\n+\ttst_res(TINFO, \"Last map: at 0x%lx-0x%lx\", start, end);\n+\treturn end;\n+}\n+\n+static unsigned long find_task_size(void)\n+{\n+\tunsigned long low, high;\n+\tvoid *p;\n+\tint page_size = getpagesize();\n+\n+\tlow = find_last_mapped();\n+\tif (!low || ((low % page_size) != 0))\n+\t\ttst_brk(TBROK, \"Bogus stack end address, 0x%lx!?\", low);\n+\n+\t/* Convert to page frame number */\n+\tlow = low / page_size;\n+\n+\t/*\n+\t * Set high to maximum possible address space\n+\t * For 64-bit: (2^64 - 1) / page_size\n+\t * We use -1UL which gives us the maximum unsigned long value\n+\t */\n+\thigh = (-1UL) / page_size;\n+\n+\ttst_res(TINFO, \"Binary searching for task size PFNs 0x%lx..0x%lx\", low, high);\n+\n+\twhile (high > low + 1) {\n+\t\tunsigned long pfn = (low + high) / 2;\n+\t\tunsigned long addr = pfn * page_size;\n+\n+\t\tp = mmap((void *)addr, page_size, PROT_READ,\n+\t\t\t   MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0);\n+\t\tif (p == MAP_FAILED) {\n+\t\t\ttst_res(TINFO | TERRNO, \"Map failed at 0x%lx\", addr);\n+\t\t\thigh = pfn;\n+\t\t} else {\n+\t\t\ttst_res(TINFO, \"Map succeeded at 0x%lx\", addr);\n+\t\t\tSAFE_MUNMAP(p, page_size);\n+\t\t\tlow = pfn;\n+\t\t}\n+\t}\n+\n+\treturn low * page_size;\n+}\n+\n+static void run_test(void)\n+{\n+\tvoid *p;\n+\tunsigned long task_size;\n+\tunsigned long straddle_addr;\n+\n+\ttask_size = find_task_size();\n+\ttst_res(TINFO, \"TASK_SIZE = 0x%lx\", task_size);\n+\n+\tstraddle_addr = task_size - hpage_size;\n+\tstraddle_addr = LTP_ALIGN(straddle_addr, hpage_size);\n+\n+\ttst_res(TINFO, \"Mapping without MAP_FIXED at %lx...\", straddle_addr);\n+\terrno = 0;\n+\tp = mmap((void *)straddle_addr, 2*hpage_size, PROT_READ|PROT_WRITE,\n+\t\t MAP_SHARED, fd, 0);\n+\tif (p == (void *)straddle_addr) {\n+\t\ttst_res(TFAIL, \"Apparently succeeded in mapping across TASK_SIZE boundary\");\n+\t\tSAFE_MUNMAP(p, 2*hpage_size);\n+\t} else if (p != MAP_FAILED) {\n+\t\ttst_res(TPASS, \"mmap without MAP_FIXED correctly avoided TASK_SIZE boundary\");\n+\t\tSAFE_MUNMAP(p, 2*hpage_size);\n+\t} else {\n+\t\ttst_res(TPASS, \"mmap without MAP_FIXED correctly failed\");\n+\t}\n+\n+\ttst_res(TINFO, \"Mapping with MAP_FIXED at %lx...\", straddle_addr);\n+\terrno = 0;\n+\tp = mmap((void *)straddle_addr, 2*hpage_size, PROT_READ|PROT_WRITE,\n+\t\t MAP_SHARED|MAP_FIXED, fd, 0);\n+\tif (p != MAP_FAILED) {\n+\t\ttst_res(TFAIL, \"Apparently succeeded in mapping across TASK_SIZE boundary\");\n+\t\tSAFE_MUNMAP(p, 2*hpage_size);\n+\t} else {\n+\t\ttst_res(TPASS, \"mmap with MAP_FIXED correctly failed\");\n+\t}\n+}\n+\n+static void setup(void)\n+{\n+\thpage_size = tst_get_hugepage_size();\n+\tfd = tst_creat_unlinked(MNTPOINT, 0, 0600);\n+}\n+\n+static void cleanup(void)\n+{\n+\tif (fd != -1)\n+\t\tSAFE_CLOSE(fd);\n+}\n+\n+static struct tst_test test = {\n+\t.needs_root = 1,\n+\t.mntpoint = MNTPOINT,\n+\t.needs_hugetlbfs = 1,\n+\t.setup = setup,\n+\t.cleanup = cleanup,\n+\t.test_all = run_test,\n+\t.hugepages = {3, TST_NEEDS},\n+};\n",
    "prefixes": []
}