Skip to content

Commit 4d2480f

Browse files
author
Rafael Aquini
committed
mm: hugetlb: conditionally disable tlb_remove_table_sync_one() in huge_pmd_unshare()
JIRA: https://issues.redhat.com/browse/RHEL-127602 Upstream status: RHEL-only This patch is a forward-port of RHEL-8 commit commit a910211a8a80a263d541186b17341f97ba47be0c Author: Rafael Aquini <raquini@redhat.com> Date: Mon Oct 13 12:47:59 2025 -0400 mm: hugetlb: conditionally disable tlb_remove_table_sync_one() in huge_pmd_unshare() JIRA: https://issues.redhat.com/browse/RHEL-120391 Upstream status: RHEL-only Provide a way to waive-off the mitigation introduced for CVE-2025-38085 as it was reported causing severe performance degradation for some customer workloads. P.S.: we are keeping the "no-cve-2025-38085" waiving alias to waive "CVE-2025-38085" because that was the option programmed on the stop-gap scratch build support has handed over to several customers. By keeping that longer waiving string we avoid these customers having to reconfigure their kernel cmdline once they update to a patched official build. Signed-off-by: Rafael Aquini <raquini@redhat.com> NOTE: this forward-port works depends on RHEL-122981 / MR 7534 commits Signed-off-by: Rafael Aquini <raquini@redhat.com>
1 parent 65fdc66 commit 4d2480f

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

Documentation/admin-guide/rh-waived-items.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ The waived items listed in the next session follow the pattern below:
2727
List of Red Hat Waived Items
2828
============================
2929

30+
- CVE-2025-38085
31+
Waiving this mitigation can help with addressing perceived performace
32+
degradation on some workloads utilizing huge-pages [1] at the expense
33+
of re-introducing conditions to allow for the data race that leads to
34+
the enumerated common vulnerability.
35+
[1] https://access.redhat.com/solutions/7132440

include/linux/rh_waived.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define _RH_WAIVED_H
1111

1212
enum rh_waived_items {
13+
CVE_2025_38085,
1314
/* RH_WAIVED_ITEMS must always be the last item in the enum */
1415
RH_WAIVED_ITEMS,
1516
};

kernel/rh_waived.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ struct rh_waived_item {
5353

5454
/* Always use the marco RH_INSERT_WAIVED to insert items to this array. */
5555
struct rh_waived_item rh_waived_list[RH_WAIVED_ITEMS] = {
56+
RH_INSERT_WAIVED_ITEM(CVE_2025_38085, "CVE-2025-38085",
57+
"no-cve-2025-38085", RH_WAIVED_CVE),
5658
};
5759

5860
/*

mm/hugetlb.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <linux/hugetlb_cgroup.h>
4646
#include <linux/node.h>
4747
#include <linux/page_owner.h>
48+
#include <linux/rh_waived.h>
4849
#include "internal.h"
4950
#include "hugetlb_vmemmap.h"
5051

@@ -7205,8 +7206,14 @@ int huge_pmd_unshare(struct mm_struct *mm, struct vm_area_struct *vma,
72057206
* using this page table as a normal, non-hugetlb page table.
72067207
* Wait for pending gup_fast() in other threads to finish before letting
72077208
* that happen.
7209+
*
7210+
* RHEL-120391: some customers reported severe interference/performance
7211+
* degradation on particular database workloads, thus we are including
7212+
* a waiving flag to allow for disabling this CVE mitigation
72087213
*/
7209-
tlb_remove_table_sync_one();
7214+
if (likely(!is_rh_waived(CVE_2025_38085)))
7215+
tlb_remove_table_sync_one();
7216+
72107217
put_page(virt_to_page(ptep));
72117218
mm_dec_nr_pmds(mm);
72127219
return 1;

0 commit comments

Comments
 (0)