Repository navigation
Rebase edera/mainline onto master @ 4405c18c95d2 - #120
Open
edera-rebase-app[bot] wants to merge 10000 commits into
Open
edera-rebase-app[bot] wants to merge 10000 commits into
edera-rebase-app[bot] wants to merge 10000 commits into
Conversation
Remove needless ')' Link: https://lore.kernel.org/all/20261112085511.690900-2-manuelebnerli@mailbox.org/ Fixes: a1dac76 ("kprobes.txt: standardize document format") Signed-off-by: Manuel Ebner <manuelebnerli@mailbox.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
…org/drm/i915/kernel into drm-fixes - Fix for PTL GitLab #9196: eDP-2 on DDI B ends up in a state where any enable fails - PSR fixes Signed-off-by: Dave Airlie <airlied@redhat.com> From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patch.msgid.link/avWCYSLHWGPjYq7z@jlahtine-mobl
…p.org/drm/amdgpu/kernel into drm-fixes amd-drm-fixes-7.4-2026-11-12: amdgpu: - DCN 6 DML2 fix - VCE fixes - GC 11.0.2 fix - SMU 15 fix - Error handling fixes - Partition fix - IMU firmware clean up fix - TLB fence handling fix amdkfd: - SVM fixes - CRIU fixes Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20261112163539.1265175-1-alexander.deucher@amd.com
Commit 596b367 ("x86/video: Only fall back to vga_default_device() without screen info") made video_is_primary_device() rely exclusively on screen_info resources whenever any are available. However, screen_info_resources() also returns legacy I/O and memory ranges for VGA text modes. These ranges are not PCI BARs, so pci_find_resource() does not find them and the default VGA fallback is skipped. As a result, no device is primary in VGA text mode. On a SeaBIOS QEMU guest with bochs and VKMS, the boot VGA (bochs) loses its DRM boot_display attribute. VKMS registers fb0 and bochs registers fb1. VKMS is not a PCI device, so it is not primary either. With no primary device, fbcon keeps the console on fb0 and never remaps it to bochs. This can be checked with: cat /sys/class/drm/card1/boot_display stty -F /dev/tty1 size Without the fix, boot_display is missing and tty1 is 48 rows by 128 columns. With it, boot_display contains 1 and tty1 is 50 rows by 160 columns. VKMS only makes the console part visible. Without VKMS, tty1 has the same size with and without the fix, but boot_display is still missing without it. Use resource-based selection only for linear framebuffers. Fall back to vga_default_device() for legacy display modes, while keeping EFI and VESA framebuffer ownership authoritative. Fixes: 596b367 ("x86/video: Only fall back to vga_default_device() without screen info") Signed-off-by: Hengyu Liang <hengyul@cs.unc.edu> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261103031630.2085194-1-hengyul@cs.unc.edu
With the dns_resolver key type available, put a key named "foo" in a fresh session keyring, revoke it, and search for "bar": keyctl new_session >/dev/null A=$(printf '127.0.0.1\0' | keyctl padd dns_resolver foo @s) keyctl revoke "$A" keyctl search @s dns_resolver bar Results: keyctl_search: Key has been revoked The search returns -EKEYREVOKED even though there is no key named "bar". It should return -ENOKEY. A dns_resolver search walks the keys in the keyring and uses dns_resolver_cmp() to compare their descriptions with the requested name. When keyring_search_iterator() sees the revoked "foo" key, it records -EKEYREVOKED in ctx->result and skips the key before comparing its description. The search continues, but without a match it returns the error recorded for "foo". Call the match callback before checking for invalidated, revoked or expired keys. A nonmatching key then leaves ctx->result alone. Fixes: b2a4df2 ("KEYS: Expand the capacity of a keyring") Reported-by: Jarkko Sakkinen <jarkko@kernel.org> Closes: https://lore.kernel.org/lkml/avDG8G-Jl1YsmfCs@kernel.org/ Signed-off-by: Guixiong Wei <weiguixiong@bytedance.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20261109032931.80406-2-weiguixiong@bytedance.com Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
keyctl_pkey_query(), keyctl_pkey_e_d_s() and keyctl_pkey_verify() check that key->type has the ->asym_*() method they need and call it later, without holding key->sem. A reference keeps the key alive, but does not pin the module that provides its type. When that module is unloaded, unregister_key_type() waits for the key GC to process every remaining key of the type. For each such key, the GC takes key->sem for writing, switches key->type to key_type_dead, whose ->asym_*() methods are NULL, and destroys the payload. If that happens between the check and the call, the keyctl calls a NULL method; if it happens while the method runs, the method returns into freed module text. In-tree, turris-signing-key provides ->asym_query() and ->asym_eds_op() and can be built as a module. Take key->sem for reading around each method call, and check the method again under it, right before the call. While the lock is held the GC cannot switch the key to key_type_dead, so unregister_key_type() and the module unload cannot complete until the method returns. If the type is already gone, the check finds key_type_dead and the keyctl fails with -EOPNOTSUPP, as it does for any key type without the method. memdup_user() and copy_to_user() stay outside key->sem, as in keyctl_read_key(), so no page fault is taken with key->sem held. The in-tree ->asym_*() methods do not take key->sem themselves. Nothing else in the kernel calls these methods, so these four call sites are the full coverage: - keyctl_pkey_query(): ->asym_query() for KEYCTL_PKEY_QUERY - keyctl_pkey_params_get_2(): ->asym_query(), and the op-specific check for KEYCTL_PKEY_ENCRYPT, _DECRYPT, _SIGN and _VERIFY - keyctl_pkey_e_d_s(): ->asym_eds_op() for _ENCRYPT, _DECRYPT and _SIGN - keyctl_pkey_verify(): ->asym_verify_signature() for _VERIFY This problem was recently fixed for keyctl_read_key() by 925c84e ("keys: Protect the read method check against type removal") and for key_update() by aef3a8a ("KEYS: Protect the update method check against type removal"). Fixes: 00d60fd ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]") Cc: stable@vger.kernel.org Signed-off-by: Yuansheng Yang <0xbeac@gmail.com> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20261110030252.9979-1-0xbeac@gmail.com Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
A key may have both a value and subkeys. When it has only one subkey, xbc_show_compact_tree() can print that subkey using dotted notation without opening a brace. During backtracking, however, it treats the value node followed by a subkey as evidence that a brace was opened. For example, a.b=v, a.b.c=w and a.z=q are printed with the brace for a closed before z. Reading that output back changes a.z into the root key z, silently changing the configuration. Check the key children when deciding whether to close a brace. Skip the value child, and account for a sole subkey that itself has both a value and subkeys, since that combination is not compacted. This follows the conditions used to open braces without keeping a depth-indexed array. Extend the mixed-value/subkey sample to cover the lost sibling. Link: https://lore.kernel.org/all/6ad67e4cda05238cd173c99e820a85de2c13f5fc.1794337724.git.edumucelli@gmail.com/ Fixes: e5efaeb ("bootconfig: Support mixing a value and subkeys under a key") Cc: stable@vger.kernel.org Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
__xbc_parse_value() trims an unquoted value when it encounters a delimiter, but leaves trailing whitespace intact when it reaches the end of the input. Thus "key = value " has a different value depending on whether the file ends with a newline. The extra whitespace also reaches the rendered kernel command line. Trim unquoted values after the scan finishes, including at end of input. Skip trimming after a closing quote so intentional whitespace in quoted values remains unchanged. Add checks for scalars, arrays and quoted values without a final newline. Link: https://lore.kernel.org/all/31f248f330e716b925add3a0ba76f62826527312.1794337724.git.edumucelli@gmail.com/ Fixes: 76db5a2 ("bootconfig: Add Extra Boot Config support") Cc: stable@vger.kernel.org Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
…/drm/xe/kernel into drm-fixes Driver Changes: - select configfs (Arnd) - Sync Wa_16023105232 in xe_was to match OOB rule (Gustavo) - Program LMTT directory pointer from each GT init path (Satya) - Demote uncorrectable local error log on CRI (Varun) - Apply tile workarounds after PCODE init (Daniel) - VRAM offlining fixes (Tejas) - ras: Fix sysctrl and drm-ras discrepancy (Roper) - pat: Return error from xe_pat_init_early() on unknown (Roper) - Prevent VF memory IRQ from accessing a torn-down engine (Piotr) - guc: Protect timeout handling from device unplug (Satya) - gt: Disable GT reset worker before engine teardown (Satya) - Various hwmon fixes (Karthik) - tuning: Restrict Anyhit NULL-query tuning to render engines (Nitin) - gsc: Fix NVL-S GSC compatibility number (Daniele) - Don't abort the shrinker walk on -EBUSY (Thomas) - Mark xe_vma_ops_alloc() noinline for error injection (Shuicheng) - lrc: Restore CTX_CS_INDIRECT_CTX_OFFSET programming for pre-Xe2 (Helen) - Fix build with DRM_XE=y and CONFIGFS_FS=m (Rodrigo) - madvise: use already clamped pat_index (Auld) - Various wedging fixes (Raag) - Rebind BOs evicted before the first LR queue (Arvind) - Toggle the D3Cold enable flag at runtime resume (Vinay) - Access GT MMIO after pcode init (Vinay) - xe_late_bind_fw: Fix firmware leak on missing manifest entry (Badal) - svm: Preserve default PAT index when resetting VMA attributes (Arvind) - Unwrap sync fences before adding them as job dependencies (Junjia) - Schedule disable G2H fixes (Jagmeet) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/avZ4bHmL2NTc4W8a@gsse-cloud1.jf.intel.com
…/kernel/git/broonie/sound into for-linus ASoC: Fixes for v7.4 Another week, another pile of driver specific fixes and quirks. We do have one major fix which addresses a bug introduced by confusion with the counted_by interfaces that was causing major disruption for a number of platforms.
Several stanzas in sound/pci/Kconfig select SND_PCM. SND_AW2 selects nothing at all. aw2-alsa calls snd_pcm_new, which sound/core/pcm.c provides under SND_PCM. aw2-alsa.c:(.text+0x554): undefined reference to `snd_pcm_new' 4 symbols are undefined in all. The driver can be built into vmlinux while SND_PCM is a module, in which case the symbols are not there at link time. Select rather than depend on: SND_PCM has no prompt of its own and is only ever enabled by a select, so a depends on would leave SND_AW2 unselectable. Reproduced on v7.3, arm64, with CONFIG_SND_AW2=y and CONFIG_SND_PCM=m. Found with kreach, a static check that compares what Kconfig allows against the symbols the compiled objects actually reference. Fixes: 98f2a97 ("[ALSA] Emagic Audiowerk 2 ALSA driver.") Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com> Link: https://patch.msgid.link/20261113064614.15045-1-jude.gyimah87@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
When an ftrace-based kprobe is registered without a post_handler, it is armed using kprobe_ftrace_ops. If a second probe with a post_handler is subsequently registered at the same address, register_aggr_kprobe() sets ap->post_handler to aggr_post_handler, but leaves the probe armed using kprobe_ftrace_ops. When the probe is later disarmed or disabled, disarm_kprobe_ftrace() checks whether p->post_handler is non-NULL and attempts to disarm from kprobe_ipmodify_ops. This fails with -ENOENT, decrements kprobe_ipmodify_enabled below zero, leaves the probe armed on kprobe_ftrace_ops, and aborts unregistration, leading to a use-after-free if the probe module is unloaded. Switch the armed probe from kprobe_ftrace_ops to kprobe_ipmodify_ops in register_aggr_kprobe() outside of text_mutex and cpus_read_lock to avoid lockdep and deadlock issues when modifying ftrace code. Defer adding the new probe onto ap->list until the ftrace ops switch completes so that the new probe's handlers are not published prematurely while ap is still on kprobe_ftrace_ops, and mark ap disabled if rollback re-arming fails. Also restore ftrace ops registration and counter if ftrace_set_filter_ip() fails in __disarm_kprobe_ftrace(). Link: https://lore.kernel.org/all/179440641120.328088.15542754095040659094.stgit@devnote2/ Fixes: 5dd7caf ("kprobes: Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
When unoptimize_kprobe() is called with force = true on an actively optimized probe (whose op->list is empty), force_unoptimize_kprobe() replaces the relative jump with a breakpoint, but leaves op->list empty without queueing op to cur->cooling_list. Because op->list remains empty, kprobe_disarmed() returns true prematurely as soon as the probe is disabled. When unregister_kprobes() runs, __unregister_kprobe_top() unhashes the probe immediately, and unregister_kprobes() frees op and the optinsn slot after synchronize_rcu() without waiting for Tasks RCU. Any task preempted inside the optinsn slot then encounters a use-after-free when resuming execution. Queue forcibly unoptimized probes onto cur->cooling_list and include gen->cooling_list in optprobe_has_queued_probes() so that the generation is dispatched and flushed properly. In do_unoptimize_kprobes(), collect newly unoptimized probes into a separate local list so that probes already placed on freeing_list are not processed a second time. Link: https://lore.kernel.org/all/179440642050.328088.13914468408589377897.stgit@devnote2/ Fixes: 06e0d3b ("kprobes: Make optprobe optimizer multi-generational and asynchronous") Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
…g probe When an optimized probe is temporarily disarmed or disabled, unoptimize_kprobe() places it on the unoptimizing list, but leaves the relative jump in text until the optimizer thread runs. __disarm_kprobe() explicitly skips arch_disarm_kprobe() when kprobe_queued_unopt(p) is true. However, if __arm_kprobe() is called before the unoptimization pass executes, it unconditionally calls arch_arm_kprobe(p), writing a breakpoint instruction over the first byte of the jump while leaving the trailing bytes intact. optimize_kprobe(p) then dequeues the probe from the unoptimizing queue, leaving the jump opcode overwritten with a breakpoint in text while KPROBE_FLAG_OPTIMIZED remains set. Skip calling arch_arm_kprobe() in __arm_kprobe() when kprobe_queued_unopt(p) is true, keeping the existing relative jump intact while unoptimization is cancelled. If optimize_kprobe() cannot optimize the probe (e.g. due to a post_handler or disabled optimization), force unoptimization immediately. Link: https://lore.kernel.org/all/179440642973.328088.10282643330198602134.stgit@devnote2/ Fixes: 06e0d3b ("kprobes: Make optprobe optimizer multi-generational and asynchronous") Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
When an optimized kprobe is disabled (for example, to arm a new kprobe in its jump-optimized instruction range), its jump is replaced with a breakpoint (or disarmed) and the probe is placed on the cooling list until the Tasks RCU grace period completes. While the disabled probe is still on the cooling list, any sibling probe whose jump range covers this probe's address cannot be optimized because can_optimize() sees the not-yet-disarmed probe via get_kprobe(). In optprobe_finalize_generation(), when a disabled probe on cooling_list finishes cooling and transitions to safely disarmed (list_del_init()), check whether an optimized sibling probe covers op->kp.addr via get_optimized_kprobe() and re-queue it for optimization, matching the freeing_list path in do_free_cleaned_kprobes(). Link: https://lore.kernel.org/all/179440643954.328088.8524265330405527243.stgit@devnote2/ Fixes: 06e0d3b ("kprobes: Make optprobe optimizer multi-generational and asynchronous") Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
With a folded PMD, pmd_addr_end() simply returns the supplied end. move_present_ptes() can therefore walk past the source or destination PTE table during UFFDIO_MOVE. pmd_addr_end() is only intended for page table traversal, in patterns like "next = pmd_addr_end(addr, end);". With folded PMDs, a higher level has already clamped the range to the PTE table. Folded PMDs are uncommon, but can occur even on arm64, for example with 64K pages and a 42-bit virtual address space. Extract the calculation from folio_pte_range() into pte_table_clamped_end() and use it to clamp both ranges. This preserves the wraparound handling from commit f681d45 ("mm: fix address wraparound when scanning large folio PTEs"). Fixes: 5094469 ("userfaultfd: opportunistic TLB-flush batching for present pages in MOVE") Cc: stable@vger.kernel.org Reported-by: Chris Mason <mason@kernel.org> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Link: https://patch.msgid.link/20261111-pte_table_clamped_end-v1-1-2dbe339c487a@kernel.org Reviewed-by: Lokesh Gidra <lokeshgidra@google.com> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
With a folded PMD, pmd_addr_end() simply returns the supplied end. folio_unmap_pte_batch() can therefore walk past the PTE table when unmapping a large folio. Folded PMDs are uncommon, but can occur even on arm64, for example with 64K pages and a 42-bit virtual address space. Use pte_table_clamped_end() to clamp the range to the PTE table and VMA boundaries. Fixes: 354dffd ("mm: support batched unmap for lazyfree large folios during reclamation") Cc: stable@vger.kernel.org Reported-by: Chris Mason <mason@kernel.org> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Link: https://patch.msgid.link/20261111-pte_table_clamped_end-v1-2-2dbe339c487a@kernel.org Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
With a folded PMD, pmd_addr_end() simply returns the supplied end. folio_referenced_one() can therefore walk past the PTE table when checking references to a large folio. Folded PMDs are uncommon, but can occur even on arm64, for example with 64K pages and a 42-bit virtual address space. Use pte_table_clamped_end() to clamp the range to the PTE table and VMA boundaries. Fixes: 52e054f ("mm: rmap: support batched checks of the references for large folios") Cc: stable@vger.kernel.org Reported-by: Chris Mason <mason@kernel.org> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Link: https://patch.msgid.link/20261111-pte_table_clamped_end-v1-3-2dbe339c487a@kernel.org Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
__split_folio_to_order() calls prep_compound_page() on each new head page
to create a compound page after clear_compound_head(). prep_compound_page()
uses non atomic __SetPageHead(). It is mostly OK, since the folio is locked
and frozen and no one else is supposed to modify the folio's flags.
However, code calling migration_entry_wait() can reach the folio by PFN,
then access its flags. It is because softleaf_entry_wait_on_locked() used
by migration_entry_wait() sets PG_waiters concurrently without taking a
reference and the frozen refcount during split cannot block it. Meanwhile,
__SetPageHead() does a plain read and write, so PG_waiters atomically set
by softleaf_entry_wait_on_locked() will be lost if the set happens after
__SetPageHead()'s read and before its write.
One example code interleaving:
CPU0: __split_folio_to_order(new_order>0) CPU1: do_swap_page()
1. clear_compound_head(new_head)
new_head->compound_info = 0
(page_folio(new_head) == new_head now)
2. migration_entry_wait()
softleaf_to_folio(entry)
page_folio() -> new_head
(not the old head any more)
3. prep_compound_page(new_head, new_order)
__SetPageHead(new_head)
tmp = new_head->flags.f <-- load; PG_waiters == 0 in tmp
4. folio_set_waiters(new_head)
set_bit(PG_waiters, &flags.f)
enqueue on waitqueue, sleep
5. new_head->flags.f = tmp | (1UL << PG_head)
<-- store; overwrites step 4, PG_waiters == 0 again
Later, folio_unlock(new_folio) sees no PG_waiters, skips folio_wake_bit(),
and CPU1 can remain blocked indefinitely.
Fix it by setting PG_head along with other flags in new_folio->flags before
smp_wmb() and clear_compound_head(). The remaining compound page metadata
is set after clear_compound_head(). In that way, after
clear_compound_head() makes new_folio visible, nothing overwrites the
PG_waiters from softleaf_entry_wait_on_locked() by modifying
new_folio->flags non-atomically.
While at it, use data_race() to suppress the KCSAN issue reported by Ye
Liu's patch (the second Closes) on reading folio->flags in
__split_folio_to_order().
Suggested-by: Kiryl Shutsemau <kas@kernel.org>
Reported-by: David Hildenbrand <david@kernel.org>
Closes: https://lore.kernel.org/all/DMHE8BEEER1H.2BIY52NXATPIA@nvidia.com/
Reported-by: Ye Liu <ye.liu@linux.dev>
Closes: https://lore.kernel.org/all/20261029-data_race_huge_mem-v1-1-112e331291c1@linux.dev/
Fixes: c010d47 ("mm: thp: split huge page to any lower order pages")
Cc: stable@vger.kernel.org
Signed-off-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Ye Liu <liuye@kylinos.cn>
Link: https://patch.msgid.link/20261110-fix-split_folio_to_order-race-v4-1-cc5042f33408@nvidia.com
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Today gnttab_dma_alloc_pages() or gnttab_dma_free_pages are never called when running as a PV guest, but this holds for in-tree callers only. Bail out early when being called in PV mode in order to ensure no out of tree module or future use cases are violating this assumption. This enables to safely remove PV-only code from both functions. Reviewed-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com> Message-ID: <20261110095605.369848-2-jgross@suse.com>
Both decrease-reservation and populate-physmap can succeed partially. For the former this may be pretty unlikely, but clearly the latter can hit both out-of-memory conditions in the hypervisor or denial because of the allocation exceeding the domain's allowance (there's no interaction with the balloon driver here either). In gnttab_dma_free_pages() we simply can't give back to the system what hasn't been re-filled with backing memory. For gnttab_dma_alloc_pages() both parts of the overall region need dealing with differently. While no present caller of gnttab_dma_free_pages() checks its return value, also don't use -EFAULT there: It really is an out-of-memory condition. (In gnttab_dma_alloc_pages() -EFAULT doesn't look quite right either, but I couldn't think of a clearly better error code there.) Fixes: 9bdc730 ("xen/grant-table: Allow allocating buffers suitable for DMA") Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com> Message-ID: <20261110095605.369848-3-jgross@suse.com>
… probes When a multiprobe event is enabled or referenced (for example, by an eprobe, trigger, or open tracefs file) and a user attempts to delete the event or one of its probes via dynamic_events, checking trace_probe_has_sibling() before the enabled and busy checks allows the first probe to be unlinked and freed while the event is still active, only returning -EBUSY on the last sibling probe. For uprobe events, unlinking and freeing an enabled sibling probe without unregistering its uprobe_consumer also causes a use-after-free. Ensure all four probe types (kprobe, fprobe, uprobe, and eprobe) verify that the event is neither enabled nor busy before unlinking any sibling probe. Link: https://lore.kernel.org/all/179455848898.403392.17675270675769076596.stgit@devnote2/ Fixes: ca89bc0 ("tracing/kprobe: Add multi-probe per event support") Fixes: 41af3cf ("tracing/uprobe: Add multi-probe per uprobe event support") Fixes: 7491e2c ("tracing: Add a probe that attaches to trace events") Fixes: 334e551 ("tracing/probes: Add fprobe events for tracing function entry and exit.") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Unlike kprobe events, fprobe and uprobe events only register their underlying probes when the trace event is enabled. When a new probe is appended to an existing multiprobe fprobe or uprobe event that is already enabled, the appended probe is linked into the event's probe list without being registered. As a result, the newly appended probe never fires until the event is disabled and re-enabled. Moreover, disabling an fprobe event calls unregister_fprobe() on the unregistered fprobe, and opening or closing a perf event on an enabled uprobe event dereferences a NULL tu->uprobe in uprobe_apply(). Register and enable the newly appended fprobe or uprobe immediately when the target event is already enabled. Link: https://lore.kernel.org/all/179455849798.403392.135678786198324285.stgit@devnote2/ Fixes: 41af3cf ("tracing/uprobe: Add multi-probe per uprobe event support") Fixes: 2db832e ("tracing: fprobe-events: Register fprobe-events only when it is enabled") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
BTF bitfield parsing in trace_probe.c assumes a 64-bit (8-byte) container when computing FETCH_OP_MOD_BF shift amounts and basesize, whereas the preceding store instruction only allocates and writes the field's fetch type size (which may be 1, 2, or 4 bytes when kflag=1). At runtime, fetch_apply_bitfield() performs an 8-byte read-modify-write on the smaller ring buffer slot, corrupting adjacent ring buffer data or writing past the end of the event record. In addition, signed bitfields with bit widths other than 8/16/32/64 fail to resolve a fetch type, bitfields whose width is a multiple of 8 inside a larger integer or spanning a byte boundary fail to emit FETCH_OP_MOD_BF or select a container wide enough for bitoffs + bitsize, kflag=0 bitfield offsets >= 8 bits are not folded into the byte offset, and big-endian architectures use the little-endian left-shift formula in parse_btf_bitfield(). Compute the bitfield byte and bit offsets consistently during field lookup, select the smallest unsigned fetch type that covers the bit offset and bit width, and calculate the FETCH_OP_MOD_BF parameters from the selected fetch type size for both big- and little-endian bitfields. Link: https://lore.kernel.org/all/179455850711.403392.10512730891220678403.stgit@devnote2/ Fixes: c440adf ("tracing/probes: Support BTF based data structure field access") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
…pers In struct btf_type, the type ID and byte size share a union, and only BTF_KIND_INT types are followed by a 32-bit integer encoding word. Because btf_type_is_char_ptr() and btf_type_is_char_array() do not verify that the outer type is BTF_KIND_PTR or that the resolved element type is a non-NULL BTF_KIND_INT before inspecting it, non-pointer BTF types can have their byte size misinterpreted as a BTF type ID, and arrays of non-integer types read out-of-bounds or misinterpret trailing BTF metadata as BTF_INT_* encoding bits. Validate the BTF type kinds and NULL pointers before reading inner type metadata in both helpers. Link: https://lore.kernel.org/all/179455851632.403392.258264246782960594.stgit@devnote2/ Fixes: 27973e5 ("tracing/probes: Add string type check with BTF") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Because the kernel is built with -funsigned-char, plain 'char' is unsigned on all architectures. Reading 1-byte signed trace event fields via *(char *)addr in get_event_field() therefore zero-extends instead of sign-extending negative s8 values. Use explicit fixed-width integer types (s8/u8, s16/u16, s32/u32) when reading event fields. Link: https://lore.kernel.org/all/179455852542.403392.15666310371702309464.stgit@devnote2/ Fixes: 7491e2c ("tracing: Add a probe that attaches to trace events") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Event probes (eprobes) are not allowed to attach to other dynamic probe events (kprobes, uprobes, and eprobes) to avoid recursive probe chains and lifecycle dependencies. However, when fprobe events were introduced, TRACE_EVENT_FL_FPROBE was omitted from the exclusion mask in find_and_get_event(), allowing eprobes to attach to fprobe and tprobe events. Exclude TRACE_EVENT_FL_FPROBE events in find_and_get_event(). Link: https://lore.kernel.org/all/179455853457.403392.14549390017750529531.stgit@devnote2/ Fixes: 334e551 ("tracing/probes: Add fprobe events for tracing function entry and exit.") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
When finalizing a string array argument (e.g. +0u(%reg):string[N]), finalize_fetch_insn() advances the instruction pointer to a new slot for the store operation before checking whether the preceding operation was FETCH_OP_UDEREF. As a result, user-space dereference string arrays with type "string" emit FETCH_OP_ST_STRING (kernel memory read) instead of FETCH_OP_ST_USTRING. Check for FETCH_OP_UDEREF before advancing the instruction pointer. Link: https://lore.kernel.org/all/179455854396.403392.18073771811100192405.stgit@devnote2/ Fixes: e65f7ae ("tracing/probe: Support user-space dereference") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
The runtime array loop (FETCH_OP_LP_ARRAY) for string types requires a preceding memory dereference instruction so it can advance the pointer address on each iteration. Non-dereference string sources such as $comm, immediate strings, and eprobe event fields cannot be indexed as pointer arrays, but finalize_fetch_insn() still accepts an array count on them and emits an invalid FETCH_OP_LP_ARRAY sequence. Reject string array counts when the preceding operation is not a memory dereference. Link: https://lore.kernel.org/all/179455855309.403392.4197028577158545202.stgit@devnote2/ Fixes: 40b53b7 ("tracing: probeevent: Add array type support") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
When generating a default event name in __trace_uprobe_create(), tail is allocated with kstrdup() without __free(kfree). If the subsequent kmalloc() for buf fails, the function returns -ENOMEM immediately and leaks tail. Declare tail with __free(kfree) so it is automatically freed on all exit paths. Link: https://lore.kernel.org/all/179455856197.403392.16569431894958507645.stgit@devnote2/ Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/all/sashiko-outbox-204240@kernel.org/ Fixes: 97e8230 ("tracing: uprobe-event: Allocate string buffers from heap") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
xen_pgd_alloc() keeps the user pgd of a 64-bit PV mm in page->private of the kernel pgd page, and xen_pgd_free() frees it without clearing the pointer. page->private shares its slot with ptdesc->ptl, so when split ptlocks are allocated separately (lock debugging, PREEMPT_RT), pagetable_dtor() hands the freed user pgd to kmem_cache_free() as a ptlock. With SLUB consistency checks this warns "virt_to_cache: Object is not a Slab page!" on every mm teardown; without them it corrupts the slab. Clear page->private once the user pgd is freed. Signed-off-by: Kavi <kavi@edera.dev>
gntdev_ioctl_grant_copy() resets nr_ops and nr_pages on the batch it takes but not writeable, and a batch fresh from kmalloc() holds whatever was in that memory. If the first segment fails before gntdev_grant_copy_seg() sets writeable, gntdev_put_pages() loads the uninitialised bool, which UBSAN reports as an invalid load. No pages are pinned at that point, so nothing is unpinned with the wrong flag. Reset writeable with the counters. Signed-off-by: Kavi <kavi@edera.dev>
Since a6aa4eb ("xen/x86: add extra pages to unpopulated-alloc if available"), a domU built below its maximum hands the rest of its physmap to the unpopulated allocator at boot, so its balloon stays empty until the toolstack first resizes it. balloon_oom_notify() only deflates pages already on the balloon, so a freshly built domU kills a task instead of growing toward its maximum. When the balloon is empty, park one 2 MiB block from the unpopulated allocator on it and deflate that, as dom0's balloon does when it grows. The allocator allocates memory with its lock held, so the OOM path only tries the lock, through a new xen_try_alloc_unpopulated_blocks(). Signed-off-by: Kavi <kavi@edera.dev>
Send each pull request from a branch in this repository to edera-dev/linux-qa, which builds the change's kernels, boots them under Xen and reports back as the linux-qa commit status. Without LXQA_DISPATCH_TOKEN this does nothing.
gcc built with -fcf-protection, the default on Ubuntu and Fedora, starts its nested-function trampolines with endbr64, or endbr32 for 32-bit code. The EMUTRAMP matchers compare the bytes at the faulting address against trampolines that start with a mov, so none of these match and the task is killed with SIGSEGV. Skip a leading endbr before matching. The only relative target, the 32-bit jmp, is computed from the address after it. Signed-off-by: Kavi <kavi@edera.dev>
pcistub_device_release() frees dev_data and clears drvdata before calling xen_pcibk_config_free_dyn_fields() and xen_pcibk_config_free_dev(). Both look the fields up through drvdata, find NULL and return, so every release from pciback leaks the device's config field entries and their data. kmemleak reports them after the device is released. Free the fields first. Fixes: cd9db80 ("xen/pciback: Support pci_reset_function, aka FLR or D3 support.") Signed-off-by: Kavi <kavi@edera.dev>
…per-V The Hyper-V-on-Xen series translates GPADLs, SynIC pages, hypercall arguments and netvsc buffers to the machine (L1-physical) frames the L0 host expects, but hv_balloon was never taught about nested mode. It hands L0 page_to_pfn() ranges straight from dom0's pseudo-physical address space, in balloon responses, free-page reports and hot-add requests, and L0 reads each of those numbers as a Xen machine frame. On a PV dom0 nested on Hyper-V the device autoloads from the VMBus offer, Xen proxies POST_MESSAGE and SIGNAL_EVENT, and the dynamic memory protocol runs end to end. A DM_BALLOON_REQUEST from the host then has L0 reclaim whichever machine frames dom0's PFNs happen to name: Xen's own memory, another domain's, or unrelated dom0 memory, with no error anywhere. A hot-add does the reverse and calls add_memory() on a host range that dom0's physmap does not back, so dom0 oopses on first touch. Translating the ranges would not make this correct either. A PV dom0 does not own the machine memory it runs on, Xen does, and the memory an L1 VM returns to or takes from L0 has to be accounted for in Xen's heap, not handed over behind its back by one of its domains. Dynamic memory for the L1 VM is a job for Xen itself. Refuse the probe when nested on Xen, so the offer stays unbound and dom0 does not speak the protocol at all. Nothing changes when not nested: hyperv_nested_on_xen is a build-time false without CONFIG_XEN_PV. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
…t be bound hyperv_xen_vpci_root_domain() frees the named fwnode when creating the irq domain fails, but not when cpuhp_setup_state() fails afterwards: irq_domain_remove() does not free the fwnode its domain was created with, so that path leaked it. Free it there too. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
MPROTECT is enforced in map_deny_write_exec(), which mmap_region() and mprotect() call, but the brk path never does. do_brk_flags() ORs in VMA_DATA_DEFAULT_FLAGS, which carries VM_EXEC whenever the task's personality has READ_IMPLIES_EXEC, and personality(2) lets any task set that for itself: the ELF loader only clears it at exec. So under MPROTECT, where mmap(PROT_READ|PROT_WRITE) with READ_IMPLIES_EXEC is correctly refused, two syscalls still hand out a fresh writable and executable mapping: personality(READ_IMPLIES_EXEC); brk(cur + len); /* new RWX VMA; it does not merge with the RW heap */ Write code there and jump to it. The same path makes the bss tail of an executable PT_LOAD segment RWX, via vm_brk_flags(..., prot & PROT_EXEC) in the ELF loader, for the binary and its interpreter. Original PaX masked VM_EXEC and VM_MAYEXEC in do_brk() for exactly this reason. Do the same in do_brk_flags() when the mm runs under MPROTECT: strip the execute bits rather than fail, so brk(2) keeps working for such tasks and extensions still merge with the existing heap. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
The trampoline emulator was hooked at the top of do_user_addr_fault(), before the VMA lookup, and openpax_fault_is_trampoline() treats any instruction fetch fault as a candidate. So in every PAGEEXEC+EMUTRAMP task every instruction fetch fault, including each demand-paged, NUMA hinted or userfaultfd fetch of legitimate text, first did up to seven get_user() reads of the faulting code, and if that text happened to match one of the patterns it was emulated instead of being faulted in. PaX only ran the emulator from the bad-area path, for a fault that was otherwise about to kill the task. Move the hook to __bad_area_nosemaphore(), after the user-mode and X86_PF_USER checks and with interrupts enabled, so it runs only for an access the task's mappings do not permit: a fetch from non-executable memory. A fetch from executable memory that merely needs its page brought in is handled as an ordinary fault and never reaches it. A fetch from a non-executable page that is not yet populated now takes two faults, one to bring the page in and one to be emulated, instead of being emulated straight from the first; the result is the same. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
With OPENPAX_EMUTRAMP_DEFAULT the ELF loader sets PAXF_EMUTRAMP on every task. The emulator then lets any task with a write primitive into some readable memory and control of the instruction pointer load chosen values into two registers and jump to a chosen address, from the stack, the heap, .rodata or a noexec-mount file mapping, without any of that memory being executable; a bad target just faults again, so such sequences chain. That weakens PAGEEXEC and MPROTECT for every program on the system to help the few that still use stack or heap trampolines. PaX recommends enabling emulation per binary for this reason. Default the option to n and say so in its help text; the programs that need emulation get it with paxmark -E, through the user.pax.flags xattr. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
Commit 1b82771 ("iommu/dma: Don't reserve PCI windows under a paravirtual IOMMU") skips iova_reserve_pci_windows() for every device the Xen IOMMU driver owns, because the windows a guest sees are invented: pcifront hands out iomem_resource itself and a PVH guest with no host-bridge _CRS gets Linux's catch-all default. That holds for a guest. Dom0 sees the real host bridges, and their windows route to the real BARs of the devices behind them. A PVH dom0 device gets a translated DMA domain, and dma-iommu hands out IOVAs top-down below 4 GiB. The driver reserves only the MSI range, so once the space above it is used, IOVAs land inside the host-bridge window where sibling devices' BARs live. On a root port or switch without ACS a DMA to such an address is decoded as peer-to-peer and delivered to the sibling's BAR: it never reaches the IOMMU, so the transfer is lost and the sibling's registers are written. Xen enables ACS where it can, which redirects such requests upstream, but that is defence in depth, not a reason to skip the reservation. Have xen_iommu_manages_iova() answer false in the initial domain, so dom0 reserves its windows as on bare metal. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
… when modular include/xen/pci.h declares pcifront_machine_sbdf() as a real function whenever CONFIG_XEN_PCIDEV_FRONTEND is defined, which it is for =m as well as =y. XEN_IOMMU is a bool and calls it from built-in code, so XEN_IOMMU=y with XEN_PCIDEV_FRONTEND=m fails to link vmlinux. Declare the function only when pcifront is built in and give built-in callers the -ENODEV stub otherwise. The IOMMU driver with that stub would silently use a pcifront device's guest BDF, which means nothing to Xen, so also keep XEN_IOMMU from being configured with a modular pcifront rather than let it build into a driver that cannot name the devices it manages. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
xen_9pfs_front_ctl() answers a backend Rlerror with -(int)ecode, and the ecode is the backend's to choose. An ecode of 0 came back as 0 and any ecode above INT_MAX came back positive, and the function's contract is "reply length or negative errno", so a caller took either for a good reply of that length. xen_9pfs_front_suspend() then read total and next from beyond the short error reply and computed the chunk length from the bogus "reply length": an ecode of 0xfff00000 had it copy about 1 MiB of uninitialised buffer into a session chunk and later hand it to the backend in Tsession_restore, and 0x80000010 had it memcpy() some 2 GiB past the reply buffer. Take only a plausible errno from an Rlerror, 1..MAX_ERRNO, and answer anything else with -EPROTO, so a control request can only ever return a negative errno or a reply that carries the id and body it asked for. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
The Connected handler replays the fids saved at suspend from xenwatch, after do_suspend() has returned and processes run again. It checked priv->client once and then read priv->client->msize for every chunk, each of which waits up to 5 s on the backend. Meanwhile a umount or a fresh mount blocked on the still-disconnected frontend can be killed: p9_client_destroy() then runs p9_xen_close(), which clears priv->client with no lock the replay holds, and frees the client. The next chunk dereferences NULL, or the freed client, and xenwatch oopses, which stops all xenbus processing for the guest. Record the owning client and its msize when the session is saved, with userspace frozen and the client known to be alive, and have the replay use those. It compares priv->client with the owner by address only, before starting and before each chunk, and gives up if they differ: a client destroyed in between does not want its fids back, and nothing is dereferenced that could have gone away. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
xen_9pfs_front_suspend() freed the session saved by the previous suspend first thing, before checking whether the frontend is connected. A guest suspended again before the backend had reconnected it, which is what happens when a restore is retried or a saved domain is forked more than once, thus lost the fids it was carrying, and the eventual restore reset the session instead of replaying them. Only free the old session once there is a connected client whose fids replace it. A frontend the backend has not reconnected since the last suspend has nothing newer to save, and the Connected handler frees the session once it has been replayed, so what is kept is never stale. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
… page's xen_9pfs_front_free_rings() took the data pages' ring_order and grant refs from the intf page, which is shared with the backend and writable by it. Upstream only freed rings from remove(), with the backend gone; since the frontend reconnects after a restore it also frees them from xen_9pfs_front_disconnect() on every resume, while a backend that still serves the old rings may be running. A backend that rewrote ref[] had the frontend end foreign access on grant refs that belong to other devices, and one that rewrote ring_order had it walk past the array or free the wrong number of pages. Keep the refs in the ring as they are granted and use those, with the order the frontend chose, to tear the ring down. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
xen_9pfs_front_ctl() stores the reply buffer and its capacity, then sets ctl_pending with a plain WRITE_ONCE(), and the response worker tests the flag with READ_ONCE() before copying into the buffer. Nothing orders the two, so on a weakly ordered machine the worker can see ctl_pending set while ctl_reply still names the previous call's buffer, a stack array or kvmalloc()ed memory that has been freed, and copy the reply into that. Publish the buffer with smp_store_release() and test the flag with smp_load_acquire(). Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
…ration and stub Commit 2e155d6 ("drivers: hv: tear down the Xen VMBus interrupt bridge on unwind") added hyperv_remove_xen_vmbus_irq() to the x86 copy of the nested-on-Xen block in asm/mshyperv.h only. The asm-generic copy that other architectures use, arm64 among them, neither declares it nor stubs it, and vmbus_drv.c calls it unconditionally, so an arm64 kernel with CONFIG_HYPERV fails to compile. The nightly arm64 build does not enable HYPERV, which is why it did not catch this. Add the declaration and the empty stub to the asm-generic block, next to hyperv_setup_xen_vmbus_irq(), so the two copies match again. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
out_of_memory() runs the OOM notifier chain with oom_lock held. On a PV domU the balloon's notifier deflates through balloon_deflate() -> xenmem_reservation_va_mapping_update() -> set_phys_to_machine(), and when the page's p2m leaf is still the shared p2m_missing page that allocates the leaf with a GFP_KERNEL __get_free_page(). Reclaim has already failed, so that allocation goes to __alloc_pages_may_oom(), whose mutex_trylock(&oom_lock) fails because we hold it; it counts that as progress, sleeps a jiffy and retries, forever. The OOM killer never runs and the guest hangs instead of killing a process. Pages with a missing leaf sit on the balloon in any PV domU built with maxmem above memory and without the unpopulated allocator, whose extra memory regions are appended at boot, and in one that hotplugged memory it has not populated yet. PVH and HVM guests are not affected, as the va-mapping update is a no-op there, nor is dom0, which does not register the notifier. Deflate under memalloc_noreclaim_save(): with PF_MEMALLOC set the allocator neither reclaims nor enters the OOM path, so the leaf either comes from the reserves or fails, and set_phys_to_machine() then fails the page cleanly. A leaf taken from the reserves lets 512 pages come back, so a memory-freeing context is the right one for this work. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
…olders gntdev_relocate_map() frees the old placeholder pages once gnttab_unmap_refs() returns 0, but that function returns 0 whenever the hypercall itself succeeded, whether or not every unmap_op in the batch was honoured; a refused op reports its failure in its own status and leaves its grant mapped. A page whose frame still carries a foreign mapping then goes back to the unpopulated pool, and the next use of that gfn has Xen crash the domain. Treat any op with a status other than GNTST_okay, for the kernel unmap ops too where they exist, as the failure it is, so the existing path that leaks the old pages and fails the map handles it. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
xenbus_ring_host_node() answered page_to_nid() of the ring's placeholder page for every HVM mapping. That is the host node of the foreign frame only when xen_mfn_to_node() resolved it at map time and the placeholders were relocated to match; nothing recorded whether it had, so the documented NUMA_NO_NODE fallback never happened. Wherever the lookup fails, in a driver domain, on a hypervisor without XENMEM_get_mfn_pxms, under an XSM policy that refuses it, or on a kernel without CONFIG_XEN_BACKEND_NUMA_AFFINITY, the placeholders come from the pool of whichever CPU xenwatch ran on, so every ring reported that one node, and netback and blkback hard-pinned every guest's queue kthreads and event-channel IRQs onto that node's CPUs. Record the resolved node on the mapping, NUMA_NO_NODE when Xen did not say, and have xenbus_ring_host_node() look it up there, as its header comment already promised. Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
edera-rebase-app
Bot
requested review from
antoineco,
azenla,
bleggett,
kaniini,
sveith and
tycho
as code owners
November 19, 2026 05:58
2 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nightly rebase of
edera/mainline(2ece1af06645) ontomaster(4405c18c95d2), driven by Claude. Not pushed automatically because the checker found drift and a build failure and Claude's report asks for a decision. Run log.Important
Do not use the merge button: this branch replaces
edera/mainlinerather than merging into it. Approve the pull request to land it; the land workflow force-pushesedera/mainlineto the approved head, pinned to2ece1af06645, and keeps a backup.Independent checks
Builds: failure (x86_64 vmlinux on the Edera host config and arm64 vmlinux, both with the Edera features built in; per-build results in the run).
The build failed and Claude's repair round (success) left no new branch; this is the unrepaired rebase.
2ece1af06645d58f6bea5d31864c07de0c7d4405c18c95d2Commits whose hunk context moved (own +/- lines identical)
ea62ac9f1b0f iommu/xen: Add Xen PV-IOMMU driver→88e1981610c2d8221bf28f22 x86/CPU/AMD: avoid printing reset reasons on Xen domU→4d13afdf368cbd1c0dba57c3 sysctl: wire up PaX softmode setting→603bab1a0fce849ed61740ea use maximum supported mmap rnd entropy by default→d188c9b8fd785b1ff5bbc8cb 9p/xen: carry the 9P session across a restore→37e9d8605e2f85e1da02b838 9p/xen: end foreign access on the grant refs we granted, not the intf page's→4e81a994dcccCommits lost, added, or whose own +/- lines changed
f492e4d0cb26 9p/xen: reconnect to the backend on resume9e1163209bc2 9p/xen: reconnect to the backend on resume3f7ca89e3d70 xen/gntdev: don't copy to user space under priv->lock (#79)2ab25ce3a8e5 xen/gntdev: don't copy to user space under priv->lock (#79)Drift (changed lines: upstream delta vs. actual change)
Claude's report
Summary
Rebased
edera/mainline(old tip2ece1af06645) from merge base864c07de0c7d(v7.2-rc5-26646-g864c07de0c7d) onto upstream4405c18c95d2(v7.2-rc5-43498-g4405c18c95d2): 15872 upstream commits. All 130 downstream commits replayed. The new tip ofrebase-resultisd58f6bea5d31. Five commits conflicted and were resolved by hand. No commit was dropped, and no build fix or fix-up commit was needed. x86_64 and arm64vmlinuxboth build.verify-upstream-rebase.shpasses the base and linearity checks. It flags 2 commits whose own +/- lines changed and some tree drift. Both come only from the conflict resolutions below, so I expect it to report that drift rather than pass clean. The items under "Needs a decision" stop the automatic push on purpose.Needs a decision
xen/gntdev: don't copy to user space under priv->lock (#79)(downstream3f7ca89e3d70, now2ab25ce3a8e5) fixes the same map-ioctl/mmap deadlock as upstream7620a997e485 xen/gntdev: fix deadlock between map ioctl and mmap(Cc: stable), but in a different way. Both droppriv->lockbeforecopy_to_user(). On a failed copy, upstream re-takes the lock and looks the map up again byop.index/op.countwithgntdev_find_map_index(). Downstream holds an extra reference across the copy and removes the map only if that exact pointer is still onpriv->maps. What I committed: the downstream version, sogntdev_ioctl_map_grant_ref()is byte-identical to the old tip. It keeps upstream's lock ordering, the only constraint upstream's fix adds. It also can't remove a different map that was given the same index after a concurrent unmap. The other reading: take upstream's version and let the downstream commit shrink to almost nothing (or drop it), which keeps this function identical to mainline and makes future stable backports apply cleanly. A maintainer should pick one.x86/CPU/AMD: avoid printing reset reasons on Xen domU(downstreamd8221bf28f22, now4d13afdf368c) applied cleanly but is now dead code. Upstreamea51d1a4c31f x86/CPU/AMD: Don't print reset reason in VMs(Cc: stable) returns early fromprint_s5_reset_status_mmio()wheneverX86_FEATURE_HYPERVISORis set. That covers every Xen PV guest, dom0 included, so the downstreamXENPV && !xen_initial_domain()check after it can never fire. It also changes behaviour: a Xen PV dom0 used to print the S5 reset reason (downstream let dom0 through), and with upstream it no longer does. What I committed: the downstream commit, replayed unchanged (harmless and redundant). The other reading: drop the downstream commit as superseded byea51d1a4c31f. If dom0 should still print the reset reason, upstream's check would need a downstream exception. I did not add one.228e21764b38 Drivers: hv: Run VMBus kexec cleanup from syscore shutdownmoveshv_kexec_handler()(vmbus_initiate_unload()pluscpuhp_remove_state(hyperv_cpuhp_online)) from x86'shv_machine_shutdown()into a VMBus syscore.shutdownhook that runs wheneverkexec_is_in_progress(). Before, it ran only when Hyper-V was the primary hypervisor, becausehv_machine_shutdownis installed by the ms_hyperv platform code. Now it also runs in the downstream Xen-PV-dom0-nested-on-Hyper-V setup (hyperv_nested_on_xen), which registers VMBus throughhv_acpi_init()but whose machine ops are Xen's. No lines conflicted. The likely effect is good (VMBus is unloaded cleanly before kexec), but in the nested case nobody has tested this path: the SynIC/Xen-VIRQ bridge teardown happens throughhv_synic_cleanupwith Xen proxying the MSRs. What I committed: nothing changed; upstream's behaviour applies. A maintainer should confirm that kexec from a nested dom0 is expected to run this, or gate it on!hyperv_nested_on_xen.Conflicts resolved
sysctl: wire up PaX softmode setting(bd1c0dba57c3, now603bab1a0fce). File:kernel/sysctl.c. Collided with upstream443bea2f71c5 sysctl: consolidate CONFIG_SYSCTL into a single block in kernel/sysctl.c(andacd19f2c56f2), which movedsysctl_subsys_tableandsysctl_init_bases()inside the single#ifdef CONFIG_SYSCTLblock and dropped the inner#ifdef CONFIG_SYSCTL. I kept upstream's layout and added the downstreampax_table(underCONFIG_OPENPAX_SOFTMODE) right beforesysctl_subsys_table, plus itsregister_sysctl_init("kernel/pax", ...)call, in the new location. The commit's own +/- lines are identical to the original; the verifier shows it as "context moved" and as drift because the hunk now sits in a different place.use maximum supported mmap rnd entropy by default(849ed61740ea, nowd188c9b8fd78). File:arch/Kconfig. Collided with upstream8cdae75cebe0 arch/Kconfig: fix dead conditions by removing dead options, which deletedARCH_MMAP_RND_BITS_DEFAULT/ARCH_MMAP_RND_COMPAT_BITS_DEFAULTand theirdefault ... if ...lines (anintused as a condition is always false, so those lines never applied). I kept the upstream removal and applied the downstream change: the remaining fallback default goes from_MINto_MAXfor both symbols. Nothing downstream referenced the removed symbols, so behaviour is unchanged.9p/xen: reconnect to the backend on resume(f492e4d0cb26, now9e1163209bc2). File:net/9p/trans_xen.c. Collided with upstreamb3d07d64832c 9p/xen: Use array for data rings(the rings array becamerings[XEN_9PFS_NUM_RINGS]inside the priv) and7b6f2e3c29fb 9p/xen: drain response work after unbinding IRQ(Fixes, Cc: stable;cancel_work_sync()moved afterunbind_from_irqhandler()). I kept the embedded array: the downstream commit reuses the same ring slots on reconnect and never reallocates the array. That means dropping thekzalloc_objs/kfree(priv->rings)/if (priv->rings)lines fromxen_9pfs_front_init()andxen_9pfs_front_free(). In the newxen_9pfs_front_free_rings()I kept upstream's ordering: skip a ring with nointf, unbind the IRQ, thencancel_work_sync(). The downstream fieldsring_order,rings_semandconnectedand all of the reconnect logic are unchanged. The downstream disconnect path (schedule_work/flush_work, then free_rings) therefore also gets upstream's unbind-then-drain ordering.9p/xen: carry the 9P session across a restore(5b1ff5bbc8cb, now37e9d8605e2f). File:net/9p/trans_xen.c. Collided with upstream9b4cf60c6b73 9p/xen: validate the response size from the backend(Fixes, Cc: stable) inp9_xen_response(), and with the rings-array change above. I kept upstream'sh.size < sizeof(h) || h.size > queuedrejection first, then the downstream intercept of theP9_NOTAGcontrol reply on ring 0, so the control path never uses an unvalidatedh.size. A bad size nowbreaks before the intercept can completectl_done. That can't hang anything becausexen_9pfs_front_ctl()waits withwait_for_completion_timeout(). I dropped the downstream rings allocation and free again (the array is embedded) and keptINIT_LIST_HEAD(&priv->session),init_completion(&priv->ctl_done)andxen_9pfs_front_session_free().ring == priv->ringsis still valid C, because the array decays to&rings[0], so I left it as written. Own +/- lines are identical; the verifier lists it as "context moved".xen/gntdev: don't copy to user space under priv->lock (#79)(3f7ca89e3d70, now2ab25ce3a8e5). File:drivers/xen/gntdev.c. Collided with upstream7620a997e485 xen/gntdev: fix deadlock between map ioctl and mmap. Both fix the same deadlock. I kept the downstream reference-counted version (see the first UNSURE item). The upstreamgntdev_find_map_index()re-lookup lines do not appear in the final tree; this is the gntdev drift the verifier reports.Dropped downstream commits
None.
Build fixes
None. The workflow sent this branch back as a failed build. Its build logs hold only
build-arm64.log, which endskernel-build: arm64 vmlinux built(a pass), and there is no x86_64 log at all, so no build error was given to fix. Rebuildingd58f6bea5d31withkernel-build.shpassed on both arches (see Builds). I changed no commit, and the branch is stilld58f6bea5d31.Upstream commits that meet the series
Fixes (Fixes:, CVE or Cc: stable) that touch files the series touches, and what the final tree shows:
a02926f7c89b xen-blkback: Avoid UAF when reading I/O statistics(XSA-528 / CVE-2026-100082): intact.rings_lockis initialised inxen_blkif_alloc(), taken for write whenrings/nr_ringsare published and torn down, and for read in the statsshow_macro. Downstream4e54ad13ce40only addshost_nodeand node placement and doesn't touchrings/nr_rings.bfddc420afe8 xen-netback: defer xenvif_mcast_addr_list_free()(XSA-527 / CVE-2026-100081): intact. The only call is inbackend_disconnect()aftersynchronize_net()(drivers/net/xen-netback/xenbus.c:270). Downstream72d7a148f049does not bring back the call inxenvif_disconnect_data().7b6f2e3c29fb 9p/xen: drain response work after unbinding IRQ: intact inxen_9pfs_front_free_rings()(see conflicts), which also covers the downstream disconnect and reconnect-error paths.9b4cf60c6b73 9p/xen: validate the response size from the backend: intact, and placed before the downstream control-reply intercept (see conflicts).4d183e6f1532 9p/xen: fix refcount leak in p9_xen_response() on wrong tag: intact (p9_req_put()on the wrong-tag path).241d46901226 9p: reject RERROR/RLERROR with zero errcode: intact inp9_check_errors(). Downstream doesn't touch it. The downstream control path intrans_xen.calready rejectsecode == 0andecode > MAX_ERRNOwith-EPROTO.2acd800de882 9p: fix caches_show() out-of-bounds write: intact (sysfs_emit_at). Downstream only adds a separatefeaturesattribute next to it.7620a997e485 xen/gntdev: fix deadlock between map ioctl and mmap: superseded by the downstream equivalent. The lock ordering is kept; see UNSURE.ea51d1a4c31f x86/CPU/AMD: Don't print reset reason in VMs: intact. It makes downstreamd8221bf28f22redundant; see UNSURE.2b66f2cc7532 Xen/gnttab: improve error handling in gnttab_dma_{alloc,free}_pages(),4ebb3b8d129c xen: don't allow gnttab_dma_[alloc|free]_pages() in PV guest,704f812cdab8 xen/grant-table: annotate on-stack work: intact. Downstream grant-table changes (xen_mfn_to_node,gnttab_alloc_pages_node) don't touch those functions.0f4a9e682f7f xattr: always invoke cap_convert_nscap() for security.capability writes: intact. Downstream only addspax_getxattr().51e766bcd35e init/main: fix false-positive kernel panic on environment variable overwrite,b82ed0e3a1da init/main: fix off-by-one in argv_init cleanup,278b2abf660a init/bootconfig: pass init arguments in documented order: intact. Downstream only addspax_softmodeand its__setup.1c8f6308e557 iommu/dma: Catch scatterlist length overflows: intact. Downstream only changes the PCI-window reservation condition iniova_reserve_iommu_regions().13fc99f46399,c386d799f423,769417e410dd,168ed9c5d5ec,0193e8336802,b1ee87802111,aa09311c40f6,f987d9f38a46,ff82ce7f90f5,4c2dec1dce36,8146c6478224,ef694e2d2101,68cb098eadda,7135a05838e8,dc0b17144d62) against the OpenPaX commits: MM_AUDIT_PLACEHOLDEROther upstream changes that meet the series without a fix tag:
8cdae75cebe0 arch/Kconfig: fix dead conditions by removing dead options: resolved; see conflicts.443bea2f71c5,acd19f2c56f2(sysctl consolidation): resolved; see conflicts.242bac52294e,d08ab285b096,2bfbb09b505c(sysctl conversion rework): no interaction, sincepax_tableuses plainproc_dointvec.b3d07d64832c 9p/xen: Use array for data rings: resolved; see conflicts.33625427a382 net/9p: add vsock transport,8bb0279930cc,9eb9b583ea35,7fb9bd365905,5852cdf0006f: no interaction with the downstream 9p client andshare_clientchanges.6eecb67b69af xen/grant-table: stop setting PG_private on pages for grant mapping: no downstream code usesPagePrivate/PG_privatein Xen code.gnttab_alloc_pages_node()still goes throughgnttab_pages_set_private()/gnttab_pages_clear_private().228e21764b38 Drivers: hv: Run VMBus kexec cleanup from syscore shutdown: see UNSURE.dd57772e36f7 Drivers: hv: vmbus: Check ACPI companion before use: no interaction with the downstreamhyperv_nested_on_xenIRQ-bridge branches invmbus_bus_init()/vmbus_exit().118bdac10546 Drivers: hv: Add logical device ID registry for vPCI devices: the registry hashtable is initialised inhv_common_init(), which the downstreamhyperv_init_nested_on_xen()calls, sohv_pci_probe()still works when nested. No overlap with the downstream nested-MSI anduse_callschanges.2690d4156b51 iommu/hyperv: Add para-virtualized IOMMU support for Hyper-V guest:x86_init.iommu.iommu_init = hv_iommu_initis set only inhyperv_init(), not in the downstream nested-on-Xen bring-up, so it can't race the Xen PV-IOMMU.1ae140d0f272 iommu: Make iommu-dma helpers private: upstream now includes"iommu-priv.h"indma-iommu.c. Downstream1b8277179ffealso adds that include (in a different spot), so the file now includes the header twice. That's harmless because the header has an include guard, so I left it.fdd81f15fc43,641a9b9cc697,95d2fec40c48,0bf031ba8c49,42eed9bb9ca4(iommu/dma-mapping): no interaction. The downstream Xen IOMMU driver doesn't usedma_opt_mapping_size()or the privatised helpers.d0ec95a8a4e7 hv_netvsc: Advertise the SR-IOV capability for CoCo VMs,56fb075b77f8 mshv: Redesign hypervisor memory deposit logic: no interaction with the downstream nested-on-Xen netvsc DMA mapping or the asm-generic declarations.0af298e62e5c treewide: refresh kmalloc_obj() conversions,bbe5d3b3d402,c2d4ccfbba3f,f000a06da2a5,10823ced2f18,8ebd2eb87f50,5728d3523f12,084100a1b579,aabe6e1b36ce,677f83795fdf,958c01049e0a,38828d44f31e,799203afd298,e3e7a85730a4,abaa0835b4f3,264d8fd2794f,28d5df7b7274,537ec2b15fdd,681f3b68f435,cf27412f19c9,2e83e2ce34ff,69d38c792c53: touch shared files only in places away from downstream hunks; no interaction. No downstream code referencesDEBUG_WX,VM_SPECIAL,is_vm_hugetlb_page,kho_scratchorhv_setup_kexec_handler.Builds
Rebuilt in the repair run, at
d58f6bea5d31:kernel-build.sh x86_64, Edera host.config from edera-dev/linux-kernel-oci@530e23bbf906, the same config commit as the rebase run). The workflow's build left no x86_64 log, so whatever it saw there could not be reproduced or diagnosed from what this run was given.kernel-build.sh arm64, defconfig). This matches the workflow's ownbuild-arm64.log, which also passed.verify-upstream-rebase.shgives the same result as before the repair: base and linearity pass, and the 2 changed commits and the drift are exactly the conflict resolutions above. There is no new drift.