public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	Ryusuke Konishi <konishi.ryusuke@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	"Borislav Petkov (AMD)" <bp@alien8.de>,
	Alexander Potapenko <glider@google.com>,
	Marco Elver <elver@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Jann Horn <jannh@google.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 6.6 02/86] x86/kfence: fix booting on 32bit non-PAE systems
Date: Mon,  9 Feb 2026 15:23:25 +0100	[thread overview]
Message-ID: <20260209142304.864049675@linuxfoundation.org> (raw)
In-Reply-To: <20260209142304.770150175@linuxfoundation.org>

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrew Cooper <andrew.cooper3@citrix.com>

commit 16459fe7e0ca6520a6e8f603de4ccd52b90fd765 upstream.

The original patch inverted the PTE unconditionally to avoid
L1TF-vulnerable PTEs, but Linux doesn't make this adjustment in 2-level
paging.

Adjust the logic to use the flip_protnone_guard() helper, which is a nop
on 2-level paging but inverts the address bits in all other paging modes.

This doesn't matter for the Xen aspect of the original change.  Linux no
longer supports running 32bit PV under Xen, and Xen doesn't support
running any 32bit PV guests without using PAE paging.

Link: https://lkml.kernel.org/r/20260126211046.2096622-1-andrew.cooper3@citrix.com
Fixes: b505f1944535 ("x86/kfence: avoid writing L1TF-vulnerable PTEs")
Reported-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Closes: https://lore.kernel.org/lkml/CAKFNMokwjw68ubYQM9WkzOuH51wLznHpEOMSqtMoV1Rn9JV_gw@mail.gmail.com/
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Alexander Potapenko <glider@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jann Horn <jannh@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/include/asm/kfence.h |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/arch/x86/include/asm/kfence.h
+++ b/arch/x86/include/asm/kfence.h
@@ -42,7 +42,7 @@ static inline bool kfence_protect_page(u
 {
 	unsigned int level;
 	pte_t *pte = lookup_address(addr, &level);
-	pteval_t val;
+	pteval_t val, new;
 
 	if (WARN_ON(!pte || level != PG_LEVEL_4K))
 		return false;
@@ -57,11 +57,12 @@ static inline bool kfence_protect_page(u
 		return true;
 
 	/*
-	 * Otherwise, invert the entire PTE.  This avoids writing out an
+	 * Otherwise, flip the Present bit, taking care to avoid writing an
 	 * L1TF-vulnerable PTE (not present, without the high address bits
 	 * set).
 	 */
-	set_pte(pte, __pte(~val));
+	new = val ^ _PAGE_PRESENT;
+	set_pte(pte, __pte(flip_protnone_guard(val, new, PTE_PFN_MASK)));
 
 	/*
 	 * If the page was protected (non-present) and we're making it



  parent reply	other threads:[~2026-02-09 14:46 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09 14:23 [PATCH 6.6 00/86] 6.6.124-rc1 review Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 01/86] nvmet-tcp: add bounds checks in nvmet_tcp_build_pdu_iovec Greg Kroah-Hartman
2026-02-09 14:23 ` Greg Kroah-Hartman [this message]
2026-02-09 14:23 ` [PATCH 6.6 03/86] platform/x86: intel_telemetry: Fix swapped arrays in PSS output Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 04/86] pmdomain: qcom: rpmpd: fix off-by-one error in clamping to the highest state Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 05/86] pmdomain: imx8mp-blk-ctrl: Keep gpc power domain on for system wakeup Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 06/86] pmdomain: imx: gpcv2: Fix the imx8mm gpu hang due to wrong adb400 reset Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 07/86] pmdomain: imx8mp-blk-ctrl: Keep usb phy power domain on for system wakeup Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 08/86] pmdomain: imx8m-blk-ctrl: fix out-of-range access of bc->domains Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 09/86] rbd: check for EOD after exclusive lock is ensured to be held Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 10/86] ARM: 9468/1: fix memset64() on big-endian Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 11/86] Revert "drm/amd: Check if ASPM is enabled from PCIe subsystem" Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 12/86] KVM: Dont clobber irqfd routing type when deassigning irqfd Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 13/86] netfilter: nft_set_pipapo: clamp maximum map bucket size to INT_MAX Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 14/86] hfsplus: fix slab-out-of-bounds read in hfsplus_uni2asc() Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 15/86] ublk: fix deadlock when reading partition table Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 16/86] sched/rt: Fix race in push_rt_task Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 17/86] binder: fix BR_FROZEN_REPLY error log Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 18/86] binderfs: fix ida_alloc_max() upper bound Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 19/86] KVM: selftests: Add -U_FORTIFY_SOURCE to avoid some unpredictable test failures Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 20/86] gve: Fix stats report corruption on queue count change Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 21/86] tracing: Fix ftrace event field alignments Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 22/86] wifi: mac80211: ocb: skip rx_no_sta when interface is not joined Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 23/86] wifi: wlcore: ensure skb headroom before skb_push Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 24/86] net: usb: sr9700: support devices with virtual driver CD Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 25/86] block,bfq: fix aux stat accumulation destination Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 26/86] smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe() Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 27/86] LoongArch: Set correct protection_map[] for VM_NONE/VM_SHARED Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 28/86] smb/server: fix refcount leak in smb2_open() Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 29/86] LoongArch: Enable exception fixup for specific ADE subcode Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 30/86] smb/server: fix refcount leak in parse_durable_handle_context() Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 31/86] HID: intel-ish-hid: Update ishtp bus match to support device ID table Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 32/86] HID: multitouch: add MT_QUIRK_STICKY_FINGERS to MT_CLS_VTL Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 33/86] btrfs: fix reservation leak in some error paths when inserting inline extent Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 34/86] HID: intel-ish-hid: Reset enum_devices_done before enumeration Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 35/86] HID: playstation: Center initial joystick axes to prevent spurious events Greg Kroah-Hartman
2026-02-09 14:23 ` [PATCH 6.6 36/86] ALSA: hda/realtek: add HP Laptop 15s-eq1xxx mute LED quirk Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 37/86] netfilter: replace -EEXIST with -EBUSY Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 38/86] HID: quirks: Add another Chicony HP 5MP Cameras to hid_ignore_list Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 39/86] HID: i2c-hid: fix potential buffer overflow in i2c_hid_get_report() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 40/86] HID: Apply quirk HID_QUIRK_ALWAYS_POLL to Edifier QR30 (2d99:a101) Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 41/86] ring-buffer: Avoid softlockup in ring_buffer_resize() during memory free Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 42/86] wifi: mac80211: collect station statistics earlier when disconnect Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 43/86] ASoC: davinci-evm: Fix reference leak in davinci_evm_probe Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 44/86] nvme-fc: release admin tagset if init fails Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 45/86] nvmet-tcp: fixup hang in nvmet_tcp_listen_data_ready() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 46/86] ASoC: amd: yc: Fix microphone on ASUS M6500RE Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 47/86] ASoC: tlv320adcx140: Propagate error codes during probe Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 48/86] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 49/86] regmap: maple: free entry on mas_store_gfp() failure Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 50/86] wifi: cfg80211: Fix bitrate calculation overflow for HE rates Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 51/86] scsi: target: iscsi: Fix use-after-free in iscsit_dec_session_usage_count() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 52/86] ALSA: hda/realtek: Fix headset mic for TongFang X6AR55xU Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 53/86] scsi: target: iscsi: Fix use-after-free in iscsit_dec_conn_usage_count() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 54/86] wifi: mac80211: correctly check if CSA is active Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 55/86] wifi: mac80211: dont increment crypto_tx_tailroom_needed_cnt twice Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 56/86] platform/x86: toshiba_haps: Fix memory leaks in add/remove routines Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 57/86] platform/x86: intel_telemetry: Fix PSS event register mask Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 58/86] platform/x86: hp-bioscfg: Skip empty attribute names Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 59/86] smb/client: fix memory leak in smb2_open_file() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 60/86] net: add skb_header_pointer_careful() helper Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 61/86] net/sched: cls_u32: use skb_header_pointer_careful() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 62/86] dpaa2-switch: prevent ZERO_SIZE_PTR dereference when num_ifs is zero Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 63/86] net: liquidio: Initialize netdev pointer before queue setup Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 64/86] net: liquidio: Fix off-by-one error in PF setup_nic_devices() cleanup Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 65/86] net: liquidio: Fix off-by-one error in VF " Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 66/86] dpaa2-switch: add bounds check for if_id in IRQ handler Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 67/86] macvlan: fix error recovery in macvlan_common_newlink() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 68/86] net: dont touch dev->stats in BPF redirect paths Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 69/86] tipc: use kfree_sensitive() for session key material Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 70/86] net: ethernet: adi: adin1110: Check return value of devm_gpiod_get_optional() in adin1110_check_spi() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 71/86] net: gro: fix outer network offset Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 72/86] drm/mgag200: fix mgag200_bmc_stop_scanout() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 73/86] hwmon: (occ) Mark occ_init_attribute() as __printf Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 74/86] netfilter: nf_tables: fix inverted genmask check in nft_map_catchall_activate() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 75/86] ipv6: Fix ECMP sibling count mismatch when clearing RTF_ADDRCONF Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 76/86] ASoC: amd: fix memory leak in acp3x pdm dma ops Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 77/86] btrfs: fix racy bitfield write in btrfs_clear_space_info_full() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 78/86] gve: Correct ethtool rx_dropped calculation Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 79/86] spi: tegra210-quad: Return IRQ_HANDLED when timeout already processed transfer Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 80/86] spi: tegra210-quad: Move curr_xfer read inside spinlock Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 81/86] spi: tegra210-quad: Protect curr_xfer assignment in tegra_qspi_setup_transfer_one Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 82/86] spi: tegra210-quad: Protect curr_xfer in tegra_qspi_combined_seq_xfer Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 83/86] spi: tegra210-quad: Protect curr_xfer clearing in tegra_qspi_non_combined_seq_xfer Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 84/86] spi: tegra: Fix a memory leak in tegra_slink_probe() Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 85/86] spi: tegra114: Preserve SPI mode bits in def_command1_reg Greg Kroah-Hartman
2026-02-09 14:24 ` [PATCH 6.6 86/86] ALSA: hda/realtek: Really fix headset mic for TongFang X6AR55xU Greg Kroah-Hartman
2026-02-09 18:15 ` [PATCH 6.6 00/86] 6.6.124-rc1 review Francesco Dolcini
2026-02-09 18:16 ` Brett A C Sheffield
2026-02-09 20:55 ` Jon Hunter
2026-02-09 21:39 ` Peter Schneider
2026-02-09 22:59 ` Florian Fainelli
2026-02-10  7:58 ` Ron Economos
2026-02-10 13:08 ` Mark Brown
2026-02-11  0:52 ` Wang Yugui
2026-02-11  3:06   ` Wang Yugui
2026-02-11 12:38     ` Greg Kroah-Hartman
2026-02-11 12:50       ` Wang Yugui
2026-02-21  1:34       ` Wang Yugui
2026-02-11  4:26 ` Shung-Hsi Yu
2026-02-11 10:23 ` Jeffrin Thalakkottoor
2026-02-11 13:44 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260209142304.864049675@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=konishi.ryusuke@gmail.com \
    --cc=mingo@redhat.com \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox