Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2219833/?format=api
{ "id": 2219833, "url": "http://patchwork.ozlabs.org/api/patches/2219833/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260404165346.1689061-1-pavrampu@linux.ibm.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": "<20260404165346.1689061-1-pavrampu@linux.ibm.com>", "list_archive_url": null, "date": "2026-04-04T16:53:46", "name": "hugemmap36: Migrating the libhugetlbfs/testcases/truncate_above_4GB.c test v6", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f8dc7545438f7d37bb3cc51819d0d6faa6f8e3af", "submitter": { "id": 91766, "url": "http://patchwork.ozlabs.org/api/people/91766/?format=api", "name": "Pavithra", "email": "pavrampu@linux.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260404165346.1689061-1-pavrampu@linux.ibm.com/mbox/", "series": [ { "id": 498740, "url": "http://patchwork.ozlabs.org/api/series/498740/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=498740", "date": "2026-04-04T16:53:46", "name": "hugemmap36: Migrating the libhugetlbfs/testcases/truncate_above_4GB.c test v6", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498740/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219833/comments/", "check": "warning", "checks": "http://patchwork.ozlabs.org/api/patches/2219833/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=mWlRGdSA;\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 4fp1rs567Gz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 02:54:05 +1000 (AEST)", "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 69F133E29EE\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 4 Apr 2026 18:54:02 +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))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id CEF243E2175\n for <ltp@lists.linux.it>; Sat, 4 Apr 2026 18:53:58 +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 DD51A200339\n for <ltp@lists.linux.it>; Sat, 4 Apr 2026 18:53:57 +0200 (CEST)", "from pps.filterd (m0360072.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 634DDYrq4193079; Sat, 4 Apr 2026 16:53:56 GMT", "from ppma22.wdc07v.mail.ibm.com\n (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dat9r9bjd-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Sat, 04 Apr 2026 16:53:55 +0000 (GMT)", "from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1])\n by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id\n 634EuFer005977;\n Sat, 4 Apr 2026 16:53:55 GMT", "from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227])\n by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4d6spyhykc-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Sat, 04 Apr 2026 16:53:55 +0000", "from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com\n [10.20.54.101])\n by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 634Grpxi60031414\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Sat, 4 Apr 2026 16:53:51 GMT", "from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id EA67820043;\n Sat, 4 Apr 2026 16:53:50 +0000 (GMT)", "from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 7A4AB20040;\n Sat, 4 Apr 2026 16:53:49 +0000 (GMT)", "from li-49acbccc-2994-11b2-a85c-d51b89e344f1.ibm.com.com (unknown\n [9.39.20.67]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP;\n Sat, 4 Apr 2026 16:53:49 +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=sjhhTXEBwDISydHNZZ6RpevCz/y04m5v9Qu+SWn3H\n 0A=; b=mWlRGdSAJEyMp9fzg9R7gT7Z4rKtB9Zov9qno/QOei4Q1YZIDCSupyOhP\n cUMaV63logyEDmiPF82GLxLNy8+Bvw4ZkbQasDiLJRvQnYHYJulQ3AdzczJ9MTVy\n MShYxGkGT+HtCoYZ3PWL8Gwfd7jwGaiBFNwyhPvfHE58x7Uo+wChAzHM0MyStzaO\n pq2bAKsw8UvQigTmmQI5YC3kcBPuBf+xQyBeQEfgbpuq79qqGu3+rtT3TdNcQjTK\n 7PTpsj/0zI5QsSp+p1cyD2r8CfAG7NRn2zWtO05XZrK74uucKrSJVHtyvodQt9pT\n Ign3xt0X/KYRwxF6wXIIJZNVWdT1w==", "From": "Pavithra <pavrampu@linux.ibm.com>", "To": "ltp@lists.linux.it", "Date": "Sat, 4 Apr 2026 22:23:46 +0530", "Message-ID": "<20260404165346.1689061-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": "yktndNt1mIiDSO4S0xg9UQNIkcCcHBN_", "X-Proofpoint-ORIG-GUID": "yktndNt1mIiDSO4S0xg9UQNIkcCcHBN_", "X-Authority-Analysis": "v=2.4 cv=bLYb4f+Z c=1 sm=1 tr=0 ts=69d14224 cx=c_pps\n a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8 a=h2lposdKRXGXhkCZEYUA:9", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDA0MDE1OCBTYWx0ZWRfX0fnVeA7ErGmO\n Rko4aXDYgjYf8t/Zne4g9xOKyb/iW5hoiOJnYIA6DB2G8hk8B39sNrlwqTFHvBm8FSoCMqvC5Dc\n xeAalaoUkcDM5SZ3gQ1e59PUP8Ukm9UObqfzlt4CdVuBFm1EHGhb2UMUV8YskubTyXzkb6pxNVC\n xSJXkPMfxEIcEJzmn0QbHuFJMSPGTx2FA8i/Mu36+qqtSkTKKUr5rYscOOq4Hd7ABEv/jF/i8PV\n Jd3hWi2+UTpfFrDo1G4Fu/pmwlwg19YxyKF3ef6ff7qBJsHKaQXl+jZYXsb7UXCNaKs2b3NLPyH\n QxMJWzVg1urnVJfSGf64kG5e9RR5yDtOSvtL4LCV6Qt2B4hpMRir74e7EVSv/8vsNQAWs3Qf/EG\n 0OZgHG05/0kyIJK0sk6rQUdb39TX2KO8j0rlTl+VY69rI2DEPv3VkpvgRTtocmaqJege9yIHgjL\n 3uo0e6tJcYq8qpqR7bg==", "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 clxscore=1015 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0\n spamscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0\n impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc=\n route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001\n definitions=main-2604040158", "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] hugemmap36: Migrating the\n libhugetlbfs/testcases/truncate_above_4GB.c test v6", "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": "Test for a bug where truncating hugepage files at offsets >= 4GB on\n32-bit systems could incorrectly truncate lower pages due to a\nmisconversion of hugetlb_vmtruncate_list to a prio_tree.\nThis test verifies that:\n- Pages below 4GB remain accessible after truncation at 4GB\n- Pages at or above the truncation point correctly trigger SIGBUS\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/hugemmap36.c | 153 ++++++++++++++++++\n 3 files changed, 155 insertions(+)\n create mode 100644 testcases/kernel/mem/hugetlb/hugemmap/hugemmap36.c", "diff": "diff --git a/runtest/hugetlb b/runtest/hugetlb\nindex 0896d3c94..bd40a7a30 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+hugemmap36 hugemmap36\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..2ddef6bf1 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/hugemmap36\n /hugetlb/hugeshmat/hugeshmat01\n /hugetlb/hugeshmat/hugeshmat02\n /hugetlb/hugeshmat/hugeshmat03\ndiff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap36.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap36.c\nnew file mode 100644\nindex 000000000..7cf4c55db\n--- /dev/null\n+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap36.c\n@@ -0,0 +1,153 @@\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+ * Test for a bug where truncating hugepage files at offsets >= 4GB on\n+ * 32-bit systems could incorrectly truncate lower pages due to a\n+ * misconversion of hugetlb_vmtruncate_list to a prio_tree.\n+ *\n+ * This test verifies that:\n+ * - Pages below 4GB remain accessible after truncation at 4GB\n+ * - Pages at or above the truncation point correctly trigger SIGBUS\n+ *\n+ * WARNING: The offsets and addresses used within are specifically\n+ * calculated to trigger the bug as it existed. Don't mess with them\n+ * unless you *really* know what you're doing.\n+ */\n+\n+#define _GNU_SOURCE\n+#define FOURGIG ((off64_t)0x100000000ULL)\n+#define MNTPOINT \"hugetlbfs/\"\n+\n+#include <signal.h>\n+#include <setjmp.h>\n+#include \"hugetlb.h\"\n+\n+static int page_size;\n+static long hpage_size;\n+static int fd = -1;\n+static long long buggy_offset;\n+static volatile int test_pass;\n+static sigjmp_buf sig_escape;\n+\n+static void sigbus_handler_fail(int signum LTP_ATTRIBUTE_UNUSED,\n+\t\t\t\tsiginfo_t *si LTP_ATTRIBUTE_UNUSED,\n+\t\t\t\tvoid *uc LTP_ATTRIBUTE_UNUSED)\n+{\n+\tsiglongjmp(sig_escape, 17);\n+}\n+\n+static void sigbus_handler_pass(int signum LTP_ATTRIBUTE_UNUSED,\n+\t\t\t\tsiginfo_t *si LTP_ATTRIBUTE_UNUSED,\n+\t\t\t\tvoid *uc 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+\tvolatile unsigned int *pi, *qi;\n+\n+\tstruct sigaction sa_pass = {\n+\t\t.sa_sigaction = sigbus_handler_pass,\n+\t\t.sa_flags = SA_SIGINFO,\n+\t};\n+\n+\tstruct sigaction sa_fail = {\n+\t\t.sa_sigaction = sigbus_handler_fail,\n+\t\t.sa_flags = SA_SIGINFO,\n+\t};\n+\n+\ttest_pass = 0;\n+\n+\tbuggy_offset = FOURGIG / (hpage_size / page_size);\n+\tbuggy_offset = (long long)PALIGN(buggy_offset, hpage_size);\n+\n+\t/* First get arena of three hpages size, at file offset 4GB */\n+\tq = SAFE_MMAP(NULL, 3*hpage_size, PROT_READ|PROT_WRITE,\n+\t\t MAP_PRIVATE, fd, FOURGIG);\n+\tqi = q;\n+\t/* Touch the high page */\n+\t*qi = 0;\n+\n+\t/* This part of the test makes the problem more obvious, but\n+\t * is not essential. It can't be done on segmented powerpc, where\n+\t * segment restrictions prohibit us from performing such a\n+\t * mapping, so skip it there. Similarly, ia64's address space\n+\t * restrictions prevent this.\n+\t */\n+#if (defined(__powerpc__) && defined(PPC_NO_SEGMENTS)) || \\\n+\t!defined(__powerpc__) && !defined(__powerpc64__) && \\\n+\t!defined(__ia64__)\n+\t/* Replace middle hpage by tinypage mapping to trigger\n+\t * nr_ptes BUG\n+\t */\n+\tp = SAFE_MMAP(q + hpage_size, hpage_size, PROT_READ|PROT_WRITE,\n+\t\t MAP_FIXED|MAP_PRIVATE|MAP_ANON, -1, 0);\n+\tpi = p;\n+\t/* Touch one page to allocate its page table */\n+\t*pi = 0;\n+#endif\n+\n+\t/* Replace top hpage by hpage mapping at confusing file offset */\n+\tp = SAFE_MMAP(q + 2*hpage_size, hpage_size, PROT_READ|PROT_WRITE,\n+\t\t MAP_FIXED|MAP_PRIVATE, fd, buggy_offset);\n+\tpi = p;\n+\t/* Touch the low page with something non-zero */\n+\t*pi = 1;\n+\n+\tSAFE_FTRUNCATE(fd, FOURGIG);\n+\n+\tSAFE_SIGACTION(SIGBUS, &sa_fail, NULL);\n+\tif (sigsetjmp(sig_escape, 1) == 0)\n+\t\tif (*pi != 1) {\n+\t\t\ttst_res(TFAIL, \"Data 1 has changed!\");\n+\t\t\tgoto cleanup;\n+\t\t}\n+\n+\tSAFE_SIGACTION(SIGBUS, &sa_pass, NULL);\n+\tif (sigsetjmp(sig_escape, 1) == 0) {\n+\t\t*qi;\n+\t\ttst_res(TFAIL, \"Didn't SIGBUS on truncated page.\");\n+\t}\n+\n+\tif (test_pass)\n+\t\ttst_res(TPASS, \"Expected SIGBUS\");\n+\n+cleanup:\n+\tSAFE_MUNMAP(q, 3*hpage_size);\n+}\n+\n+static void setup(void)\n+{\n+\tpage_size = getpagesize();\n+\thpage_size = tst_get_hugepage_size();\n+\tfd = tst_creat_unlinked(MNTPOINT, 0, 0600);\n+\tif (hpage_size > FOURGIG)\n+\t\ttst_brk(TCONF, \"Huge page size is too large!\");\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.tags = (struct tst_tag[]) {\n+\t\t{\"linux-git\", \"856fc2950555\"},\n+\t\t{}\n+\t},\n+\t.needs_root = 1,\n+\t.mntpoint = MNTPOINT,\n+\t.needs_hugetlbfs = 1,\n+\t.hugepages = {4, TST_NEEDS},\n+\t.setup = setup,\n+\t.cleanup = cleanup,\n+\t.test_all = run_test,\n+};\n", "prefixes": [] }