Repository navigation
Rebase edera/mainline onto master @ 23c62304dde2 - #112
Closed
edera-rebase-app[bot] wants to merge 10000 commits into
Closed
edera-rebase-app[bot] wants to merge 10000 commits into
edera-rebase-app[bot] wants to merge 10000 commits into
Conversation
With async encryption, a record can be transmitted without its TLS header on weakly ordered architectures such as arm64, because the consumer may observe rec->tx_ready set while still seeing the old scatterlist entry. tls_encrypt_done() restores the TLS header in the scatterlist entry (sge->offset -= prot->prepend_size, sge->length += prot->prepend_size) and then publishes the record with smp_store_mb(rec->tx_ready, true). On another CPU, tls_tx_records() checks rec->tx_ready with READ_ONCE() and then reads the entry in tls_push_sg(). Nothing orders these accesses. The barrier in smp_store_mb() comes after the tx_ready store, so it does not order the earlier scatterlist update before it. On the reader side, READ_ONCE() does not order the later loads of sge->offset and sge->length. The reader can therefore see tx_ready set together with the old offset and length, and pushes the record without its header. Publish tx_ready with smp_store_release() in tls_encrypt_done() and read it with smp_load_acquire() in tls_tx_records(), so that observing tx_ready guarantees the restored scatterlist entry is visible. Keep the full barrier that smp_store_mb() provided as an explicit smp_mb(), as it is still needed to order the tx_ready store before the tx_list head check. The issue was discovered during development on an arm64 system. A curl download test over kTLS failed with: curl: (56) OpenSSL SSL_read: error:0A00010B:SSL routines::wrong version number, errno 0 Fixes: a42055e ("net/tls: Add support for async encryption of records for performance") Signed-off-by: Ofri Zangi <ofriz@xsightlabs.com> Link: https://patch.msgid.link/20261108-tls-async-tx-ordering-v1-1-f9a1844ca88e@xsightlabs.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
The T4 and RE-CONFIG timeout handlers take a reference to their cached control chunk and submit it through SCTP_CMD_REPLY. A previous transmission can still be on the control outqueue when output is corked or suppressed, or when sctp_packet_transmit_chunk() could not append the chunk. sctp_outq_tail() then adds the same list node a second time. Re-adding a non-tail entry can corrupt the list without being caught by the insertion-time list checks. A subsequent flush or association teardown can access an already freed chunk. The ASCONF path is reproducible by an unprivileged SCTP socket owner in a user/network namespace, with KASAN reporting a use-after-free in __sctp_outq_teardown(). Check sctp_chunk_pending() in both timeout handlers before taking the extra reference and issuing SCTP_CMD_REPLY. If the chunk is already linked, leave the existing entry for normal output processing. Keep the remaining timer and error-handling commands unchanged. This also covers RE-CONFIG retransmission after sctp_assoc_rm_peer() moves the request to another transport and starts its timer. The issue was found by an LLM. Fixes: 2e3216c ("sctp: Follow security requirement of responding with 1 packet") Fixes: 7b9438d ("sctp: add stream reconf timer") Cc: stable@kernel.org Suggested-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: Kyle Zeng <kylebot@openai.com> Acked-by: Xin Long <lucien.xin@gmail.com> Link: https://patch.msgid.link/20261107030532.32310-1-kylebot@openai.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
…rted When SHAMPO and relaxed ordering writes are enabled, aligned RQ end padding can corrupt received TCP data. Due to reordering, alignment padding written at the end of one packet can overwrite data from the next packet. The current RQ end padding selection avoids alignment padding for LRO, but not for SHAMPO. Extend the condition to SHAMPO to prevent this corruption. The issue was observed in a two-host test using a BlueField-3 NIC and an NVIDIA H20 GPU. In the original test with MTU 1500, 354 of 400 transfers contained corrupted data before the fix. After applying this change, all 400 transfers across eight message sizes from 32 KiB to 4 MiB, with 50 transfers per size, completed successfully, with no incorrect bytes or corrupted intervals. Fixes: e5ca8fb ("net/mlx5e: Add control path for SHAMPO feature") Closes: https://lore.kernel.org/r/CAFxp=AY2cVRQrZvB9WNnigbsobuw11NMG-cagHx0_V+ur2ToFw@mail.gmail.com Link: https://lore.kernel.org/r/atZKOtjrb9HKSNHF@dtatulea-c5.nvidia.com Suggested-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Cc: stable@vger.kernel.org Signed-off-by: Jiabin Deng <dengjiabin2023@gmail.com> Link: https://patch.msgid.link/20261110035723.26587-1-dengjiabin2023@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
HWS has no duplicate match. When a flower filter is replaced in place,
its new rule waits as the pending duplicate of the old FTE. Once the
old rule goes, switch_to_pending_act_dests() copies the pending actions
over the FTE before update_fte() releases the actions of the old rule.
An HWS rule reads the base id of its meter action through a pointer to
the exe_aso of the FTE. That release takes the meter action of the new
rule instead.
When the two meters sit in different ASO objects, the old meter action
leaks. It keeps its ASO object referenced. The firmware then fails to
destroy that object and to free the PD of the meters, and its STC is
still in the pool when the context closes. The new meter action is
destroyed one release early, while a rule still points to it, and the
last release underflows its refcount:
mlx5_core 0000:b1:00.1: mlx5_cmd_out_err:822:(pid 2641): DESTROY_GENERAL_OBJECT(0xa03) op_mod(0x24) failed, status bad resource(0x5), syndrome (0xeeda5c), err(-22)
refcount_t: underflow; use-after-free.
WARNING: lib/refcount.c:96 at refcount_dec_not_one+0x3f/0x60, CPU#43: tc/2641
Call Trace:
<TASK>
mlx5_fs_put_hws_action.part.0+0x1a/0xa0 [mlx5_core]
mlx5_fs_destroy_fs_actions+0xa8/0x110 [mlx5_core]
mlx5_cmd_hws_delete_fte+0x49/0x90 [mlx5_core]
del_hw_fte+0x209/0x320 [mlx5_core]
mlx5_del_flow_rules+0x10b/0x260 [mlx5_core]
__mlx5_eswitch_del_rule+0x5c/0x1b0 [mlx5_core]
mlx5_eswitch_del_offloaded_rule+0x10/0x20 [mlx5_core]
mlx5e_tc_rule_unoffload+0x4b/0x100 [mlx5_core]
mlx5e_tc_unoffload_fdb_rules+0x35/0x80 [mlx5_core]
mlx5e_tc_del_fdb_flow+0x2ca/0x310 [mlx5_core]
mlx5e_tc_del_flow+0x5d/0x2d0 [mlx5_core]
mlx5e_flow_put+0x3a/0x80 [mlx5_core]
mlx5e_delete_flower+0x291/0x460 [mlx5_core]
mlx5e_setup_tc_block_cb+0xc4/0x110 [mlx5_core]
tc_setup_cb_destroy+0xcc/0x1b0
fl_hw_destroy_filter+0xa1/0xe0 [cls_flower]
__fl_delete+0x2d0/0x3d0 [cls_flower]
fl_destroy+0xbd/0x160 [cls_flower]
tcf_proto_destroy+0x3b/0x110
tcf_proto_put+0x3d/0x70
tc_del_tfilter+0x362/0x8f0
rtnetlink_rcv_msg+0x384/0x460
netlink_rcv_skb+0x61/0x120
rtnetlink_rcv+0x15/0x30
netlink_unicast+0x2a1/0x3d0
netlink_sendmsg+0x237/0x490
____sys_sendmsg+0x33b/0x360
___sys_sendmsg+0x99/0xf0
__sys_sendmsg+0x93/0x100
__x64_sys_sendmsg+0x1d/0x30
x64_sys_call+0x821/0x23d0
do_syscall_64+0xba/0x550
entry_SYSCALL_64_after_hwframe+0x76/0x7e
</TASK>
mlx5_core 0000:b1:00.1: mlx5_cmd_out_err:822:(pid 2642): DEALLOC_PD(0x801) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0xef0c8a), err(-22)
mlx5_core 0000:b1:00.1: mlx5hws_pool_destroy:386:(pid 2642): Attempting to destroy non-empty pool
Keep the base id in the rule action, as the sampler id is.
Discovered while stress testing a 5G UPF kernel code. Without this fix,
the reproduction below gives the trace above on a ConnectX-7 with
firmware 28.48.1000. It only uses tc and devlink, with no kernel
change. 129 meters cannot fit in one ASO object. DEV is the uplink
representor and PCI its devlink handle:
r() { echo "filter $1 dev $DEV ingress prio 1 handle $2 protocol ip flower skip_sw dst_ip 10.0.0.$2 action police index $3 rate 1mbit burst 32k conform-exceed drop/pipe action drop"; }
devlink dev param set $PCI name flow_steering_mode value hmfs cmode runtime
devlink dev eswitch set $PCI mode switchdev
tc qdisc add dev $DEV ingress
for i in $(seq 129); do r add $i $i; done | tc -b -
r replace 1 1000 | tc -b -
tc filter del dev $DEV ingress prio 1
devlink dev eswitch set $PCI mode legacy
With this fix, the reproduction runs clean on the same ConnectX-7.
It was not tested against kernel selftests.
Fixes: 82d3639 ("net/mlx5: fs, add support for flow meters HWS action")
Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20261110173437.2471233-1-acassen@corp.free.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
gud_stats_debugfs() computes the compression ratio by dividing the accumulated uncompressed length by stats_actual_length. That counter is zero until the first framebuffer flush has completed, so reading the stats debugfs file on a display which negotiates LZ4 compression raises a divide error before any frame has been sent. The wrap-around reset in gud_flush_rect() also clears the counter for a moment, which a concurrent read can observe. Copy the counter into a local variable and skip the ratio computation when it is zero. Fixes: 40e1a70 ("drm: Add GUD USB Display driver") Cc: stable@vger.kernel.org Co-developed-by: Bin Yu <byu@xidian.edu.cn> Signed-off-by: Bin Yu <byu@xidian.edu.cn> Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn> Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn> Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Acked-by: Ruben Wauters <rubenru09@aol.com> Link: https://patch.msgid.link/20261029073311.14556-1-25031212351@stu.xidian.edu.cn Signed-off-by: Ruben Wauters <rubenru09@aol.com>
Messed up rc1, backmerging rc2. Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Tile workarounds program SoC registers through MMIO. Wait for PCODE initialization to complete before applying them during system resume, since MMIO access may be blocked until SoC initialization completes. Also apply tile workarounds after PCODE initialization on D3cold runtime resume, so their register settings are restored after power loss. Keep both paths ordered before early GT resume. Fixes: 0d05347 ("drm/xe/wa: Apply tile workarounds at probe/resume") Signed-off-by: Daniel Charles <daniel.charles@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patch.msgid.link/20261103021418.654723-2-daniel.charles@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> (cherry picked from commit 641ffb2) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
The UNCORRECTABLE_LOCAL_ERROR notification sent by the GuC indicates a
local, queue-level context termination rather than a global device or
driver failure. On CRI, due to a hardware limitation, the platform cannot
distinguish GT translation faults from true RAS conditions, meaning
standard workloads routinely trigger this error.
Printing this at ERROR level is too noisy and causes false-positive
dmesg-warn failures in CI. Demote the log level to debug for CRI.
v5:
- Correct commmit message and comment (Tejas)
v4:
- Change to _dbg instead of _info. (Matt)
v3:
- Limit the demotion to CRI and add comment explaining the HW limitation
(Rodrigo)
v2:
- Also ratelimit the GUC_ID_UNKNOWN to match the CAT error handler.
(Himal)
Fixes: 4e57574 ("drm/xe/guc: Handle GuC local uncorrectable error notifications")
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Varun Gupta <varun.gupta@intel.com>
Link: https://patch.msgid.link/20261106034804.2005214-2-varun.gupta@intel.com
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
(cherry picked from commit e305536)
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
The LMTT directory pointer is configured on every GT of the tile only from the primary GT's init/reset flow. On new platforms, both primary and media GTs have their own forcewake. Primary GT's init holds only its own forcewake, so the media GT write can be lost. Program the LMTT directory pointer from each GT's own init and restart path, while that GT's forcewake is held. Also use MCR registers for primary GT and unicast registers for media GT. Fixes: ad69d62 ("drm/xe/pf: Program LMTT directory pointer on all GTs within a tile") Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com> Cc: Piotr Piórkowski <piotr.piorkowski@intel.com> Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Stuart Summers <stuart.summers@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patch.msgid.link/20261105114923.880265-4-satyanarayana.k.v.p@intel.com (cherry picked from commit a8653be) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Wa_16023105232 was extended in xe_wa_oob.rules to match extra IP releases while the respective entry in xe_was[] was overlooked. Update the latter to be in sync with the former. Also add comments in the code so that we don't forget to update both places if new IP versions are added. Fixes: c96e0df ("drm/xe/xe3: Add support for media IP version 30.02") Fixes: 4fde666 ("drm/xe/xe3: Add support for graphics IP versions 30.04 & 30.05") Cc: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Cc: Shekhar Chauhan <shekhar.chauhan@intel.com> Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com> Link: https://patch.msgid.link/20261105-wa_16031259911-v3-2-da6ec790aa29@intel.com Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com> (cherry picked from commit 0cfb54f) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
The original addition of configfs to xe missed a compile-time dependency, which leads to a link failure when configfs is enabled as a loadable module: ld.lld-21: error: undefined symbol: xe_configfs_get_survivability_mode >>> referenced by xe_survivability_mode.c:224 >>> drivers/gpu/drm/xe/xe_survivability_mode.o:(xe_survivability_mode_is_requested) in archive vmlinux.a A recent workaround added a 'IS_REACHABLE()' check around the calls into configfs, which makes it link in this configuration, but this is generally a bad idea because it makes the actual behavior inconsistent and confusing to users that expect configfs to work if both xe and configfs are enabled. Use 'select CONFIGFS_FS' instead, like every other configfs user does, and remove the unnecessary stub functions. There is little practical difference here as anyone using XE graphics is likely to have a complex configuration that already selects configfs anyway, and the link error or the IS_REACHABLE() would only manifest during randconfig testing. Fixes: da475c0 ("drm/xe: Fix build with DRM_XE=y and CONFIGFS_FS=m") Fixes: 16280de ("drm/xe: Add configfs to enable survivability mode") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20261026102603.2045493-1-arnd@kernel.org Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (cherry picked from commit be73339) Signed-off-by: Matthew Brost <matthew.brost@intel.com>
gpiod_shared_put() races with concurrent calls to
devm_gpiod_shared_get() like so:
CPU 0 (unbind / probe failure) CPU 1 (concurrent proxy probe)
============================== ==============================
gpiod_shared_put()
kref_put(&entry->ref, ...)
refcount_dec_and_test() // -> 0
devm_gpiod_shared_get()
mutex_lock(&entry->lock);
if (entry->shared_desc) {
kref_get(&entry->ref); // on 0!
shared_desc = entry->shared_desc;
}
mutex_unlock(&entry->lock);
gpio_shared_release()
mutex_lock(&entry->lock);
kfree(shared_desc);
entry->shared_desc = NULL;
mutex_unlock(&entry->lock);
// uses freed shared_desc
Because gpiod_shared_put() decrements entry->ref without holding
entry->lock and gpio_shared_release() only acquires entry->lock after the
reference count has already reached zero, a concurrent call to
devm_gpiod_shared_get() can acquire entry->lock in the intermediate window
and observe a non-NULL entry->shared_desc. This can result in a
use-after-free and a double-free when the second consumer releases its
reference.
Use kref_put_mutex() to ensure the entry lock is taken without a window
in which a concurrent user can see a non-NULL entry->shared_desc while
it's being released.
Cc: stable@vger.kernel.org
Closes: https://sashiko.dev/#/bug/linux-30e071e4-4e4a-4b63-bd83-df1147055d35
Fixes: a060b8c ("gpiolib: implement low-level, shared GPIO support")
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261110-gpio-shared-refcnt-race-v2-1-8a0b76e01714@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
In gpiochip_add_hog(), parsing a device tree with an excessively large "#gpio-cells" property causes a stack out-of-bounds write when populating the GPIO specification. The value read from #gpio-cells is used to copy the values into right places in struct fwnode_reference_args but that struct's args field is an array of size NR_FWNODE_REFERENCE_ARGS so a value larger than it will make the loop write past the end of that array. If #gpio-cells is 0, we can trigger a divide-by-zero later when calculating the actual number of hogs. If #gpio-cells is 1, we can also perform an out-of-bounds read of the "gpios" array. Reject #gpio-cells larger than NR_FWNODE_REFERENCE_ARGS, lower than 1 and make sure #gpio-cells is larger than 1 before checking the active-low flag. Cc: stable@vger.kernel.org Fixes: 802c51a ("gpiolib: fix hogs with multiple lines") Closes: https://sashiko.dev/#/bug/linux-fdec1c0e-c6e3-4eb6-8746-d68a3f951374 Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20261110-gpiolib-hog-stack-corruption-v2-1-c5b28cb8dc8e@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
The existing on-disk summary mainly describes inode and shared xattr metadata views, leaving the overall layout and design rationale unclear. Expand the summary and refine the terminology and wording while keeping the section a high-level overview. Assisted-by: chatgpt:gpt-6.1-sol Reviewed-by: Chengyu Zhu <hudsonzhu@tencent.com> Signed-off-by: Gao Xiang <xiang.gao@docker.com>
Linking a file with copy up origin into a non-merge impure dir does not bump the dir version. readdir then reuses the impure dir cache built before the link. It reports the upper inode number as d_ino of the new link, not st_ino. Pass whether the linked file has an origin to ovl_dir_modified(), as rename and unlink do. Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://sashiko.dev/#/bug/linux-98f207b6-3936-48e9-a40f-88f20be4db7b Fixes: 4edb83b ("ovl: constant d_ino for non-merge dirs") Cc: stable@vger.kernel.org Signed-off-by: Daejun Park <daejun7.park@samsung.com> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Merge cpufreq fixes and fixes related to runtime PM for 7.4-rc3: - Fix the synchronization of boost state updates in cpufreq (Christian Loehle) - Fix issues related to system suspend-resume synchronization in the cpufreq core and intel_pstate driver (Rafael Wysocki) - Fix P-state index mismatch in extract_io() in the ACPI cpufreq driver on systems with defective _PSS (Li RongQing) - Fix issues related to target frequency caching in cpufreq (Rafael Wysocki) - Prevent a false-positive warning in pm_runtime_remove() introduced by a previous fix during the 7.0 development cycle (Zhou Minqiang) - Extend a recent improvement related to the handling of suppliers during device runtime-suspend to some previously missed cases in which it is relevant for consistency (Brian Norris) - Update runtime PM documentation to reflect new behavior after recent changes (Stanley Jhu) - Add last_busy timestamp updates for devices requested to resume from runtime suspend that are missing if those devices are not actually suspended (Rafael Wysocki) * pm-cpufreq: cpufreq: Fix updates of cached resolved frequency and index cpufreq: Cache post-resolution target frequency in __resolve_freq() cpufreq: acpi-cpufreq: fix P-state index mismatch in extract_io() cpufreq: Serialize global boost updates cpufreq: Preserve global boost state on failed updates cpufreq: intel_pstate: Use rdmsrq_safe() to read MSR_MISC_PWR_MGMT cpufreq: intel_pstate: Clear last written P-state value on suspend cpufreq: Force passing target frequency to driver during resume cpufreq: Improve suspend-resume synchronization cpufreq: Hold the policy write lock when changing boost state * pm-runtime: PM: runtime: Update last_busy in rpm_resume() for active devices PM: runtime: Update runtime_pm.rst for non-fatal resume errors PM: runtime: Only queue an idle check for RPM-linked suppliers (part 2) PM: runtime: Fix check_flush_dependency warning from pm_runtime_remove
bin_bo_alloc() arms the out-of-memory interrupt once it has allocated the binner BO, and accessing a V3D register requires the block to be powered. vc4_submit_cl_ioctl() already holds a runtime PM reference by the time it reaches vc4_get_bcl(), but vc4_create_bo_ioctl() reaches vc4_grab_bin_bo() without one, so the write can land on a suspended device. Take the reference in vc4_v3d_bin_bo_get(), which covers both callers, and take it before bin_bo_lock so that runtime PM is never waited for with the mutex held. Cc: stable@vger.kernel.org Fixes: 35c8b4b ("drm/vc4: Allocate binner bo when starting to use the V3D") Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patch.msgid.link/20261111-vc4-irq-cleanup-v2-1-aa757bb742f2@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
The out-of-memory interrupt is armed once, by bin_bo_alloc(), when the binner BO is allocated. vc4_irq_disable() masks it on the way down, vc4_irq_enable() brings back only the render bits, and bin_bo_alloc() does not run again for a binner BO that is still referenced. An overflow after an autosuspend therefore raises nothing and the binner stalls, until the hangcheck resets the GPU and arms the interrupt again. Therefore, derive the out-of-memory bit in vc4_irq_enable() from whether a binner BO exists, which is the condition bin_bo_alloc() was standing in for. While here, clear the complement of the wanted mask while enabling. V3D_INTENA and V3D_INTDIS are set/clear registers and the driver only ever set bits, so a source left enabled will stay enabled and can reach vc4_irq(), which returns IRQ_NONE for anything outside the three bits it handles. Cc: stable@vger.kernel.org Fixes: 35c8b4b ("drm/vc4: Allocate binner bo when starting to use the V3D") Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patch.msgid.link/20261111-vc4-irq-cleanup-v2-2-aa757bb742f2@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
vc4_reset() masks the IRQ line through vc4_irq_disable(), which calls disable_irq(), but nothing in the reset path calls enable_irq(). The line stays disabled after the first GPU hang, so later jobs only retire through further hangcheck resets. Commit 6abc8e4 ("drm/vc4: Disable the V3D interrupt across runtime suspend") was written against drm-misc-fixes, where the GPU was still reset with a runtime suspend/resume cycle and the resume callback re-enabled the line. Commit b444882 ("drm/vc4: Use the reset controller to recover from a GPU hang") removed that cycle, so once both landed, enable_irq() was no longer reached. Move enable_irq() into vc4_irq_enable(), which both runtime resume and vc4_irq_reset() call, so every path that disables V3D interrupts also re-enables the IRQ line. Fixes: b444882 ("drm/vc4: Use the reset controller to recover from a GPU hang") Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patch.msgid.link/20261111-vc4-irq-cleanup-v2-3-aa757bb742f2@igalia.com Signed-off-by: Maíra Canal <mcanal@igalia.com>
Commit 3fcece1 ("net: store port/representator id in metadata_dst") dropped the options_len equality check when converting skb_metadata_dst_cmp() to a type switch, so the memcmp length is taken from skb a alone. When skb b carries fewer options than a, the comparison reads past b's allocation. Hit in practice with Cilium geneve GRO aggregation, comparing an skb carrying 12 bytes of tunnel options against one carrying none: memcmp: detected buffer overflow: 108 byte read of buffer size 96 WARNING: CPU: 0 PID: 15 at lib/string_helpers.c:1036 __fortify_report __fortify_panic+0x9/0x10 skb_metadata_dst_cmp+0x11b/0x120 dev_gro_receive+0x303/0x620 gro_cell_poll+0x67/0xa0 Restore the check: unequal options_len means different metadata and no aggregation; the memcmp only runs when both sides carry the same options length. Fixes: 3fcece1 ("net: store port/representator id in metadata_dst") Cc: stable@vger.kernel.org Cc: Ilya Maximets <i.maximets@ovn.org> Cc: Sasha Levin <sashal@kernel.org> Cc: Jakub Kicinski <kuba@kernel.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Eric Dumazet <edumazet@kernel.org> Cc: Paolo Abeni <pabeni@redhat.com> Cc: Simon Horman <horms@kernel.org> Cc: Sridhar Samudrala <sridhar.samudrala@intel.com> Cc: Kees Cook <kees@kernel.org> Signed-off-by: Jean-Paul Sergent <jpsergent@gmail.com> Link: https://patch.msgid.link/20261109082410.206140-1-jpsergent@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Merge core ACPI support code fixes and an ACPI APEI fix for 7.4-rc3: - Avoid printing diagnostic messages for ACPI device objects after dropping reference to them (Sasha Levin) - Avoid holding the physical_node_lock for ACPI device objects across device_offline() and device_online() due to a potential deadlock that causes lockdep to complain and turn itself off (Sasha Levin) - Make recoverable CPU, memory, CXL and vendor-specific errors reported through GHES show up in vmcores by fixing a broken error severity check in ghes_log_hwerr() (Breno Leitao) * acpi-scan: ACPI: scan: Do not hold physical_node_lock across device_offline() and device_online() ACPI: scan: Print the offline failure message in acpi_bus_offline() * acpi-apei: ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr()
Overayfs mounted with index=on or nfs_export=on require file handle support from backing filesystems. Overlay file handles identify a backing filesystem, but not the lower mount used to decode it. If lower layers share a superblock and use different idmaps, a handle can decode through the wrong layer. Record the first idmap on a private lower clone for each backing filesystem. Fail if another clone has a different idmap. Comparing the private clones prevents mount_setattr() from changing the checked state. Distinct idmap objects are treated as ambiguous. Fixes: bc70682 ("ovl: support idmapped layers") Suggested-by: Christian Brauner <brauner@kernel.org> Link: Link: https://lore.kernel.org/all/20260925-server-hager-riskieren-06116eded213@brauner/ Cc: stable@vger.kernel.org Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
If the snd_pcm_update_hw_ptr call from snd_pcm_status is what triggers the xrun state (eg, as opposed to an IRQ), the returned status->state was stale and told userspace the device was still playing, so they could get confused about device state and hang indefinitely. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222201 Signed-off-by: Mikael Magnusson <mikachu@gmail.com> Link: https://patch.msgid.link/20261112094636.13671-1-mikachu@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
snd_disconnect() unregisters the input device via
snd_usb_caiaq_input_disconnect() and only afterwards kills the EP1
command URB (cdev->ep1_in_urb). The EP1 completion handler
usb_ep1_command_reply_dispatch() feeds snd_usb_caiaq_input_dispatch()
for EP1_CMD_READ_{ERP,ANALOG,IO} replies, which report into
cdev->input_dev. Since commit b04dcbb ("ALSA: caiaq: Use
snd_card_free_when_closed() at disconnection") the input device is
unregistered from snd_usb_caiaq_input_disconnect() but cdev->input_dev
is cleared only later, in snd_usb_caiaq_input_free() from the card
destructor. As the dispatch guard only tests cdev->input_dev for NULL,
an EP1 reply that completes after input_unregister_device() but before
cdev->ep1_in_urb is killed reports into an input device that has
already been unregistered and, with no evdev client holding it open,
freed.
Normally the window is closed by the USB core: usb_unbind_interface()
calls usb_disable_interface() before ->disconnect(), which flushes the
EP1 URB as long as endpoint 0x81 belongs to the interface being
unbound. But caiaq addresses EP1 through the device-wide pipe
usb_rcvbulkpipe(usb_dev, 0x1) without checking which interface owns
the endpoint. If a device declares it in another interface, the URB
stays live across snd_disconnect() of the interface that owns the card.
This needs a crafted device descriptor; a device that has EP1 in the
interface caiaq is bound to is not affected.
Kill cdev->ep1_in_urb (and the paired midi_out_urb) before the input
and audio disconnect helpers, so no EP1 completion can run once the
input device has been unregistered.
Reproduced under KASAN with raw-gadget + dummy_hcd emulating an Audio
Kontrol 1 (17cc:0815) with the EP1 bulk pair in interface 1: only
interface 0 was bound to snd-usb-caiaq and then unbound through sysfs
while the gadget flooded EP1 with EP1_CMD_READ_ERP replies. With no PCM
stream running the window is very short and was only hit by stalling
the unbinding CPU with a kgdb breakpoint at
snd_usb_caiaq_audio_disconnect(). With the fix applied, the same test
runs clean.
BUG: KASAN: slab-use-after-free in input_event+0x3a/0xc0
Read of size 8 at addr ffff8880151a4028 by task sh/118
Call Trace:
<IRQ>
input_event+0x3a/0xc0
snd_usb_caiaq_input_dispatch+0xab2/0xf00
usb_ep1_command_reply_dispatch+0x1f3/0x580
__usb_hcd_giveback_urb+0x246/0x400
dummy_timer+0x1415/0x3380
__hrtimer_run_queues+0x39d/0x800
hrtimer_run_softirq+0x187/0x2d0
handle_softirqs+0x1ff/0x930
__irq_exit_rcu+0x15b/0x210
irq_exit_rcu+0xe/0x20
sysvec_apic_timer_interrupt+0x81/0xb0
</IRQ>
<TASK>
asm_sysvec_apic_timer_interrupt+0x1a/0x20
RIP: 0010:snd_usb_caiaq_audio_disconnect+0x0/0x70
snd_disconnect+0x81/0x110
usb_unbind_interface+0x1a0/0x860
device_release_driver_internal+0x2c5/0x470
unbind_store+0xde/0x100
</TASK>
Allocated by task 80:
input_allocate_device+0x47/0x340
snd_usb_caiaq_input_init+0x4c/0x1ac0
snd_probe+0xab3/0x1160
usb_probe_interface+0x2ea/0x810
Freed by task 118:
kfree+0x1ea/0x5c0
input_dev_release+0xab/0xd0
device_release+0xcf/0x250
kobject_put+0x169/0x320
snd_disconnect+0x79/0x110
usb_unbind_interface+0x1a0/0x860
Fixes: b04dcbb ("ALSA: caiaq: Use snd_card_free_when_closed() at disconnection")
Cc: stable@vger.kernel.org
Signed-off-by: Sergei Nizovtsev <snizovtsev@cloudlinux.com>
Assisted-by: Claude:claude-opus-4-8
Link: https://patch.msgid.link/20261112094904.2430318-1-snizovtsev@cloudlinux.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This unit don't support headphone MIC. The popping sound will disappear when you remove it. Fixes: 97272a5 ("ALSA: hda/realtek - Fixed Headphone noise issue for Dell QCM1255") Signed-off-by: Kailang Yang <kailang@realtek.com> Link: https://lore.kernel.org/3c8129fbfa6d4ee2b464735f2f31dffa@realtek.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add an idmapped overlay test for two lower layers that share a backing superblock but use different idmaps. Check that mount creation with index=on fails with EINVAL. Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
The Acer Predator PHN16-72 (1025:1731) uses the ALC245 codec, but its mic-mute LED is not enabled by default. Replace the existing quirk with ALC245_FIXUP_ACER_MICMUTE_LED quirk to enable the mic-mute LED chain the existing ALC2XX_FIXUP_HEADSET_MIC quirk. Fixes: 34e08ad ("ALSA: hda/realtek: Add quirk for Acer Predator PHN16-72") Signed-off-by: Fa-Iz Faadhillah Ibrahim <faiz.faadhillah@gmail.com> Link: https://patch.msgid.link/20261111172108.30011-1-faiz.faadhillah@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
This reverts commit 82cfab6. The quirk entry seems matching with other multiple irrelevant models that lead to a regression on those. Maybe we should use HDA_CODEC_QUIRK() entry for the corresponding codec SSID, instead. But let's revert for addressing the regression at first. Fixes: 82cfab6 ("ALSA: hda/cs420x: Add CS4208 fixup for MacBookAir 7,2") Closes: https://lore.kernel.org/71fb1e29-60e1-4522-a071-c53557cea39b@icloud.com Closes: https://lore.kernel.org/CABWzDrqrskmtb7MVFgJ54k4WNSqby7Qo3R1XeoVBaJ+djaO1ew@mail.gmail.com Cc: <stable@vger.kernel.org> Link: https://patch.msgid.link/20261112124844.694544-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
When a socket joins a multicast group, the ifindex of the device is stored in the socket's membership entry. When leaving, ip_mc_leave_group() resolves the device again from the request. If the request only specifies an interface address and that address is not assigned to any device, no device is found. The membership is still matched by address and removed from the socket, but the group is not released on the device it was joined on. The group is then leaked on the device until the device is unregistered. An unprivileged user can trigger this by joining with an ifindex and a non-local address and leaving with the address only. It can also happen when a socket joins and leaves with the address only and the address is removed in between. Fix by resolving the device from the ifindex stored in the membership, like ip_mc_drop_socket() does. Fixes: 4eba7bb ("ipv4: igmp: Allow removing groups from a removed interface") Signed-off-by: Junyoung Jang <graypanda.inzag@gmail.com> Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20261109125312.2208874-1-graypanda.inzag@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
In Meta production, we have had tasks get stuck in a fault loop while
using hugetlb on arm64. During my investigations I found that affected
tasks share a private hugetlb page.
Looking at the stuck task states, I found the following ordering:
CPU0 CPU1
---- ----
read page
[read only entry cached in TLB]
write page
hugetlb_fault()
hugetlb_wp()
[reuse folio]
set_huge_ptep_maybe_writable()
set_huge_ptep_writable()
[flush local TLB only]
write page using stale entry
hugetlb_fault()
huge_ptep_set_access_flags()
[entry already writable, no flush]
retry write using stale entry
[fault indefinitely. well, that's not ideal!]
The reason is that when a write fault makes a non-contiguous hugetlb
entry writable, it only invalidates the local TLB. However, another CPU
can keep the old read-only entry, so its write will fault even though
the page table already permits it. hugetlb_fault() then finds nothing to
change and leaves the stale entry in place, so the same write keeps
going round in circles.
This is particularly bad because, if the kernel is copying to user
memory, the retry stays inside the kernel and the task can't act on the
pending signal.
It can even remain unkillable while holding locks across the copy,
resulting in further failures. For example, a read into a hugetlb
buffer can hold the pipe mutex and block other users of the pipe until
the loop ends, causing cascading lockups across the machine.
To fix this, when a write fault finds nothing to change in a
non-contiguous hugetlb entry, let's invalidate the local entry.
Fixes: cb1fa2e ("arm64, tlbflush: don't TLBI broadcast if page reused in write fault")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Down <chris@chrisdown.name>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
gntdev_ioctl_map_grant_ref() calls copy_to_user() with priv->lock held. A fault in that copy takes mmap_lock, while gntdev_mmap() is called with mmap_lock held and takes priv->lock, so lockdep reports a circular dependency, and a thread mapping grants can deadlock against another thread of the same process mmapping the same gntdev fd. Read the index under the lock, take an extra reference on the map, and copy after unlocking. If the copy fails, take the map off the list only if an unmap ioctl has not already done so, then drop both references. Fixes: 45ca1af ("xen/gntdev: fix error handling in ioctl") Signed-off-by: Kavi <kavi@edera.dev>
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>
edera-rebase-app
Bot
requested review from
antoineco,
azenla,
bleggett,
kaniini,
sveith and
tycho
as code owners
November 15, 2026 04:51
2 of 4 tasks
commented
Nov 16, 2026
Author
|
Superseded by #114. |
edera-rebase-app
Bot
deleted the
rebase/edera-mainline/20261115-7ad1695c933c-23c62304dde2
branch
November 16, 2026 05:00
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(7ad1695c933c) ontomaster(23c62304dde2), driven by Claude. Not pushed automatically because the checker found no result (it did not run) 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 to7ad1695c933c, and keeps a backup.Independent checks
Builds: success (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 checker did not run.
Claude's report
Summary
Rebased
edera/mainline(old tip7ad1695c933c) from merge base864c07de0c7d(v7.2-rc5-26646-g864c07de0c7d) onto upstream23c62304dde2(v7.2-rc5-43108-g23c62304dde2), a range of 15515 non-merge upstream commits. All 126 downstream commits were replayed in order ontorebase-result(tipef69faa75bf0), with no merges, drops, squashes or rewording. Five commits conflicted and were resolved by hand; no commit went empty. Both x86_64 and arm64 build.verify-upstream-rebase.shreports the branch is on the upstream tip and linear. It flags two commits whose own +/- lines changed and some drift. All of that comes from the conflict resolutions below and is expected, so the checker will not pass clean. Two items need a maintainer decision.Needs a decision
xen/gntdev: don't copy to user space under priv->lock (#79)and upstream7620a997e485 xen/gntdev: fix deadlock between map ioctl and mmap(Cc: stable) fix the same deadlock ingntdev_ioctl_map_grant_ref(). Both carry the sameFixes: 45ca1afe2fd1tag. Both droppriv->lockbeforecopy_to_user(); they differ only in the-EFAULTpath.gntdev_find_map_index(index, count).priv->maps.drivers/xen/gntdev.cis byte-identical to the downstream post-image (blobb0ae02e10cd0). Refcounts balance on every path, and matching by pointer avoids a narrow case in upstream's version: if another thread unmaps the map and a new map reuses the same index and count, upstream would remove the wrong map. Upstream's ordering constraint (nocopy_to_user()underpriv->lock) is kept.drivers/xen/gntdev.c.228e21764b38 Drivers: hv: Run VMBus kexec cleanup from syscore shutdownchanges behaviour on the Hyper-V-nested-on-Xen path without touching the same lines. Before,hv_kexec_handler()was reached only through the x86 machine-kexec hook, which is installed only on native Hyper-V, so a Xen PV dom0 nested under Hyper-V never ran it. Now it runs from the VMBus syscore.shutdowncallback (drivers/hv/vmbus_drv.c~2918–2930) wheneverkexec_is_in_progress(). On kexec the nested dom0 will therefore callvmbus_initiate_unload(false)and remove the hyperv cpuhp state. It does this without tearing down the downstream Xen VMBus interrupt bridge, becausehyperv_remove_xen_vmbus_irq()is only called fromvmbus_exit()and theerr_connectpath.hyperv_nested_on_xen.Conflicts resolved
sysctl: wire up PaX softmode setting, filekernel/sysctl.c. Collided with443bea2f71c5 sysctl: consolidate CONFIG_SYSCTL into a single block in kernel/sysctl.c(plusacd19f2c56f2), which movedsysctl_subsys_tableandsysctl_init_bases()into the firstCONFIG_SYSCTLblock and dropped the inner#ifdef CONFIG_SYSCTL. I kept upstream's layout and put the samepax_tableandregister_sysctl_init("kernel/pax", pax_table)lines at the new location. The commit's own +/- lines are unchanged; it shows as drift only because the code moved.use maximum supported mmap rnd entropy by default, filearch/Kconfig. Collided with8cdae75cebe0 arch/Kconfig: fix dead conditions by removing dead options, which removedARCH_MMAP_RND_{,COMPAT_}BITS_DEFAULTand theirdefault ... if ...lines. I kept the removal and applied the downstream change (default ..._MIN→default ..._MAXfor both symbols). The removed conditional defaults always evaluated false, so behaviour is unchanged, and nothing in the tree references the removed symbols.9p/xen: reconnect to the backend on resume, filenet/9p/trans_xen.c. Collided withb3d07d64832c 9p/xen: Use array for data ringsand7b6f2e3c29fb 9p/xen: drain response work after unbinding IRQ(Cc: stable).rings[XEN_9PFS_NUM_RINGS]array, adding the downstreamring_order,rings_semandconnectedfields.xen_9pfs_front_free_rings()split, kept upstream's order: unbind the IRQ, thencancel_work_sync().xen_9pfs_front_free()now callsxen_9pfs_front_free_rings()unconditionally, with noif (priv->rings)and nokfree(priv->rings).xen_9pfs_front_init()keeps the downstreamring_orderandinit_rwsem()setup but loses thekzallocof the rings, which upstream removed.9p/xen: carry the 9P session across a restore, filenet/9p/trans_xen.c. Collided with9b4cf60c6b73 9p/xen: validate the response size from the backend(Cc: stable) andb3d07d64832c.p9_xen_response()sits where upstream added theh.sizecheck. I put upstream's check first, then the control branch, which also advancesconsbyh.size. A malformed control reply therefore stops the loop as upstream intends, and the control waiter times out (wait_for_completion_timeout) instead of the ring spinning.xen_9pfs_front_free()(addsxen_9pfs_front_session_free()) andxen_9pfs_front_init()(addsINIT_LIST_HEADandinit_completion, nokzalloc).xen/gntdev: don't copy to user space under priv->lock (#79), filedrivers/xen/gntdev.c. Collided with7620a997e485. Kept the downstream version; see the first item under Needs a decision.The run hit two transient errors fetching blobs from the promisor remote (
upload-pack: not our ref). They interrupted the picks of63d25eed3b79 xen: add xen_mfn_to_node...and85e1da02b838 9p/xen: end foreign access on the grant refs we granted.... Both times the commit had been marked done but not applied. I re-applied each withgit cherry-pickof the same commit, which applied cleanly, and continued the rebase. The checker shows neither commit as changed.Dropped downstream commits
None.
Build fixes
None.
Upstream commits that meet the series
Fixes. For each, I read the final tree:
9b4cf60c6b73 9p/xen: validate the response size from the backend: intact. The size check (net/9p/trans_xen.c~295–301) runs before the downstream control branch. That branch copies only whenh.size <= ctl_reply_cap, andh.sizeis already bounded by the queued bytes.7b6f2e3c29fb 9p/xen: drain response work after unbinding IRQ: intact inxen_9pfs_front_free_rings(), which runs unbind →cancel_work_sync()→ free. The downstreamxen_9pfs_front_disconnect()first doesschedule_work+flush_workwith the IRQ still bound, then callsfree_rings, which does unbind-then-cancel underrings_semheld for write. The worker does not takerings_sem. The race is not reintroduced.4d183e6f1532 9p/xen: fix refcount leak in p9_xen_response() on wrong tag: intact. The downstream control branch never callsp9_tag_lookup().241d46901226 9p: reject RERROR/RLERROR with zero errcode: intact innet/9p/client.c. The downstream control-request Rlerror parsing intrans_xen.calso rejectsecode == 0(and> MAX_ERRNO) with-EPROTO.7620a997e485 xen/gntdev: fix deadlock between map ioctl and mmap: superseded by the downstream variant. See Needs a decision.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 in gnttab_unmap_refs_sync(),6eecb67b69af xen/grant-table: stop setting PG_private on pages for grant mapping: intact. The downstreamgnttab_alloc_pages_node()uses the same private-data helpers (which no longer set PG_private) and the same free path.a02926f7c89b xen-blkback: Avoid UAF when reading I/O statistics,bfddc420afe8 xen-netback: defer xenvif_mcast_addr_list_free(): intact. The downstream NUMA-placement commits don't touch the code these fixes changed.b1ee87802111,0193e8336802,168ed9c5d5ec,769417e410dd,c386d799f423,aa09311c40f6(mm/vma fixes),4c2dec1dce36 mm/ksm: fix use of a freed anon_vma at swap-in,ef694e2d2101 fork: take mmap_lock before copying mm_struct: intact. The OpenPaX hunks inmm/vma.c/mm/mmap.c/mm/util.cdon't overlap them.pax_flagsis still inherited throughdup_mm's copy, now under mmap_lock.cf27412f19c9 x86/bugs: Mitigate TSA on AMD Zen5: intact. It is independent of the downstream Xen domU reset-reason change inamd.c.0f4a9e682f7f xattr: always invoke cap_convert_nscap() for security.capability writes: intact. The downstream change only adds PaX xattr retrieval.51e766bcd35e,b82ed0e3a1da(init/main argv/env fixes): intact.pax_softmode=is a plain__setup.Other upstream commits touching series files (checked, no action needed):
b3d07d64832c 9p/xen: Use array for data rings: absorbed in the resolutions above. No leftover NULL checks orkfreeofpriv->rings.443bea2f71c5,acd19f2c56f2,242bac52294e,d08ab285b096,2bfbb09b505c(sysctl):proc_dointvecis unchanged for the PaX table.8cdae75cebe0 arch/Kconfig: fix dead conditions by removing dead options: resolved above.35e340a47888 mm: userland pgtable freeing is RCU-safe now...(arch/Kconfig): unrelated hunk.228e21764b38 Drivers: hv: Run VMBus kexec cleanup from syscore shutdown: see Needs a decision.dd57772e36f7 Drivers: hv: vmbus: Check ACPI companion before use: no effect. The nested dom0 still enumerates VMBus through ACPI.118bdac10546 Drivers: hv: Add logical device ID registry for vPCI devices: works on the nested path, becausehyperv_init_nested_on_xen()callshv_common_init().56fb075b77f8 mshv: Redesign hypervisor memory deposit logic: the removed helper is not used downstream.2690d4156b51 iommu/hyperv: Add para-virtualized IOMMU support for Hyper-V guest: itsiommu_inithook is set only inhyperv_init(), which does not run on Xen PV, so it does not start in the nested dom0.1ae140d0f272 iommu: Make iommu-dma helpers private:drivers/iommu/xen-iommu.cuses none of the helpers made private. Upstream now includes"iommu-priv.h"indma-iommu.c, which the downstreamiommu/dma: Don't reserve PCI windows under a paravirtual IOMMUalready did, so the file includes it twice. That is harmless because of the include guard; dropping the downstream line is an optional cleanup.1c8f6308e557,fdd81f15fc43,641a9b9cc697,95d2fec40c48(dma-iommu): don't overlap the downstream hunk.d0ec95a8a4e7 hv_netvsc: Advertise the SR-IOV capability for CoCo VMs: independent of the downstream DMA-map change; the nested dom0 is not isolated.0af298e62e5c treewide: refresh kmalloc_obj() conversions: mechanical.72a993449cb0eliminate VM_SPECIAL,c911e7ebebf5renameis_vm_hugetlb_page(), and the othermm/vmaAPI changes): no downstream code uses a removed or renamed identifier.9eb9b583ea35,2acd800de882,7fb9bd365905,8bb0279930cc,33625427a382,5852cdf0006f): no interaction.init/main.cbootconfig changes (278b2abf660a,958c01049e0a,677f83795fdf,aabe6e1b36ce,2e83e2ce34ff): no interaction.kernel-parameters.txt: no interaction.Separately, and not caused by this rebase (the old tip has it too):
drivers/hv/vmbus_drv.ccallshyperv_remove_xen_vmbus_irq(), but it is declared only inarch/x86/include/asm/mshyperv.h. A non-x86 build withCONFIG_HYPERV_VMBUSwould likely fail with an implicit declaration. arm64 defconfig hasCONFIG_HYPERVunset, so the builds below don't exercise it.Builds