This is the start of the stable review cycle for the 5.15.182 release.
There are 55 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sat, 10 May 2025 11:25:42 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.182-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.15.182-rc2
Tudor Ambarus <tudor.ambarus(a)linaro.org>
dm: fix copying after src array boundaries
Nicolin Chen <nicolinc(a)nvidia.com>
iommu/arm-smmu-v3: Fix iommu_device_probe bug due to duplicated stream ids
Jason Gunthorpe <jgg(a)ziepe.ca>
iommu/arm-smmu-v3: Use the new rb tree helpers
Björn Töpel <bjorn(a)rivosinc.com>
riscv: uprobes: Add missing fence.i after building the XOL buffer
Suzuki K Poulose <suzuki.poulose(a)arm.com>
irqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode()
Thomas Gleixner <tglx(a)linutronix.de>
irqchip/gic-v2m: Mark a few functions __init
Xiang wangx <wangxiang(a)cdjrlc.com>
irqchip/gic-v2m: Add const to of_device_id
Christian Hewitt <christianshewitt(a)gmail.com>
Revert "drm/meson: vclk: fix calculation of 59.94 fractional rates"
Fiona Klute <fiona.klute(a)gmx.de>
net: phy: microchip: force IRQ polling mode for lan88xx
Sébastien Szymanski <sebastien.szymanski(a)armadeus.com>
ARM: dts: opos6ul: add ksz8081 phy properties
Cristian Marussi <cristian.marussi(a)arm.com>
firmware: arm_scmi: Balance device refcount when destroying devices
Yonglong Liu <liuyonglong(a)huawei.com>
net: hns3: fix deadlock issue when externel_lb and reset are executed together
Sergey Shtylyov <s.shtylyov(a)omp.ru>
of: module: add buffer overflow check in of_modalias()
Richard Zhu <hongxing.zhu(a)nxp.com>
PCI: imx6: Skip controller_id generation logic for i.MX7D
Jian Shen <shenjian15(a)huawei.com>
net: hns3: defer calling ptp_clock_register()
Hao Lan <lanhao(a)huawei.com>
net: hns3: fixed debugfs tm_qset size
Yonglong Liu <liuyonglong(a)huawei.com>
net: hns3: fix an interrupt residual problem
Yonglong Liu <liuyonglong(a)huawei.com>
net: hns3: add support for external loopback test
Jian Shen <shenjian15(a)huawei.com>
net: hns3: store rx VLAN tag offload state for VF
Mattias Barthel <mattias.barthel(a)atlascopco.com>
net: fec: ERR007885 Workaround for conventional TX
Thangaraj Samynathan <thangaraj.s(a)microchip.com>
net: lan743x: Fix memleak issue when GSO enabled
Michael Liang <mliang(a)purestorage.com>
nvme-tcp: fix premature queue removal and I/O failover
Michael Chan <michael.chan(a)broadcom.com>
bnxt_en: Fix ethtool -d byte order for 32-bit values
Shruti Parab <shruti.parab(a)broadcom.com>
bnxt_en: Fix out-of-bound memcpy() during ethtool -w
Shruti Parab <shruti.parab(a)broadcom.com>
bnxt_en: Fix coredump logic to free allocated buffer
Felix Fietkau <nbd(a)nbd.name>
net: ipv6: fix UDPv6 GSO segmentation with NAT
Simon Horman <horms(a)kernel.org>
net: dlink: Correct endianness handling of led_mode
Xuanqiang Luo <luoxuanqiang(a)kylinos.cn>
ice: Check VF VSI Pointer Value in ice_vc_add_fdir_fltr()
Brett Creeley <brett.creeley(a)intel.com>
ice: Refactor promiscuous functions
Victor Nogueira <victor(a)mojatatu.com>
net_sched: qfq: Fix double list add in class with netem as child qdisc
Victor Nogueira <victor(a)mojatatu.com>
net_sched: ets: Fix double list add in class with netem as child qdisc
Victor Nogueira <victor(a)mojatatu.com>
net_sched: hfsc: Fix a UAF vulnerability in class with netem as child qdisc
Victor Nogueira <victor(a)mojatatu.com>
net_sched: drr: Fix double list add in class with netem as child qdisc
Louis-Alexis Eyraud <louisalexis.eyraud(a)collabora.com>
net: ethernet: mtk-star-emac: rearm interrupts in rx_poll only when advised
Louis-Alexis Eyraud <louisalexis.eyraud(a)collabora.com>
net: ethernet: mtk-star-emac: fix spinlock recursion issues on rx/tx poll
Biao Huang <biao.huang(a)mediatek.com>
net: ethernet: mtk-star-emac: separate tx/rx handling with two NAPIs
Chris Mi <cmi(a)nvidia.com>
net/mlx5: E-switch, Fix error handling for enabling roce
Maor Gottlieb <maorg(a)nvidia.com>
net/mlx5: E-Switch, Initialize MAC Address for Default GID
Jakub Kicinski <kuba(a)kernel.org>
net/sched: act_mirred: don't override retval if we already lost the skb
Sean Christopherson <seanjc(a)google.com>
KVM: x86: Load DR6 with guest value only before entering .vcpu_run() loop
Jeongjun Park <aha310510(a)gmail.com>
tracing: Fix oob write in trace_seq_to_buffer()
Mingcong Bai <jeffbai(a)aosc.io>
iommu/vt-d: Apply quirk_iommu_igfx for 8086:0044 (QM57/QS57)
Pavel Paklov <Pavel.Paklov(a)cyberprotect.ru>
iommu/amd: Fix potential buffer overflow in parse_ivrs_acpihid
Benjamin Marzinski <bmarzins(a)redhat.com>
dm: always update the array size in realloc_argv on success
Mikulas Patocka <mpatocka(a)redhat.com>
dm-integrity: fix a warning on invalid table line
Wentao Liang <vulab(a)iscas.ac.cn>
wifi: brcm80211: fmac: Add error handling for brcmf_usb_dl_writeimage()
Ruslan Piasetskyi <ruslan.piasetskyi(a)gmail.com>
mmc: renesas_sdhi: Fix error handling in renesas_sdhi_probe
Vishal Badole <Vishal.Badole(a)amd.com>
amd-xgbe: Fix to ensure dependent features are toggled with RX checksum offload
Helge Deller <deller(a)gmx.de>
parisc: Fix double SIGFPE crash
Will Deacon <will(a)kernel.org>
arm64: errata: Add missing sentinels to Spectre-BHB MIDR arrays
Clark Wang <xiaoning.wang(a)nxp.com>
i2c: imx-lpi2c: Fix clock count when probe defers
Niravkumar L Rabara <niravkumar.l.rabara(a)altera.com>
EDAC/altera: Set DDR and SDMMC interrupt mask before registration
Niravkumar L Rabara <niravkumar.l.rabara(a)altera.com>
EDAC/altera: Test the correct error reg offset
Philipp Stanner <phasta(a)kernel.org>
drm/nouveau: Fix WARN_ON in nouveau_fence_context_kill()
Joachim Priesner <joachim.priesner(a)web.de>
ALSA: usb-audio: Add second USB ID for Jabra Evolve 65 headset
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/dts/imx6ul-imx6ull-opos6ul.dtsi | 3 +
arch/arm64/kernel/proton-pack.c | 2 +
arch/parisc/math-emu/driver.c | 16 +-
arch/riscv/kernel/probes/uprobes.c | 10 +-
arch/x86/include/asm/kvm-x86-ops.h | 1 +
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/svm/svm.c | 13 +-
arch/x86/kvm/vmx/vmx.c | 11 +-
arch/x86/kvm/x86.c | 3 +
drivers/edac/altera_edac.c | 9 +-
drivers/edac/altera_edac.h | 2 +
drivers/firmware/arm_scmi/bus.c | 3 +
drivers/gpu/drm/meson/meson_vclk.c | 6 +-
drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +-
drivers/i2c/busses/i2c-imx-lpi2c.c | 4 +-
drivers/iommu/amd/init.c | 8 +
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 79 ++---
drivers/iommu/intel/iommu.c | 4 +-
drivers/irqchip/irq-gic-v2m.c | 8 +-
drivers/md/dm-integrity.c | 2 +-
drivers/md/dm-table.c | 5 +-
drivers/mmc/host/renesas_sdhi_core.c | 10 +-
drivers/net/ethernet/amd/xgbe/xgbe-desc.c | 9 +-
drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 24 +-
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 11 +-
drivers/net/ethernet/amd/xgbe/xgbe.h | 4 +
drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c | 30 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 36 ++-
drivers/net/ethernet/dlink/dl2k.c | 2 +-
drivers/net/ethernet/dlink/dl2k.h | 2 +-
drivers/net/ethernet/freescale/fec_main.c | 7 +-
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 +
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 2 +-
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 119 ++++++--
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 3 +
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 61 ++--
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 26 +-
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c | 13 +-
.../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 25 +-
.../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 1 +
drivers/net/ethernet/intel/ice/ice_fltr.c | 58 ++++
drivers/net/ethernet/intel/ice/ice_fltr.h | 12 +
drivers/net/ethernet/intel/ice/ice_main.c | 49 +--
drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 5 +
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 139 ++++-----
drivers/net/ethernet/mediatek/mtk_star_emac.c | 339 ++++++++++++---------
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 5 +-
drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 11 +-
drivers/net/ethernet/mellanox/mlx5/core/rdma.h | 4 +-
drivers/net/ethernet/microchip/lan743x_main.c | 8 +-
drivers/net/ethernet/microchip/lan743x_main.h | 1 +
drivers/net/phy/microchip.c | 46 +--
.../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 6 +-
drivers/nvme/host/tcp.c | 31 +-
drivers/of/device.c | 7 +-
drivers/pci/controller/dwc/pci-imx6.c | 5 +-
kernel/trace/trace.c | 5 +-
net/ipv4/udp_offload.c | 61 +++-
net/sched/act_mirred.c | 22 +-
net/sched/sch_drr.c | 9 +-
net/sched/sch_ets.c | 9 +-
net/sched/sch_hfsc.c | 2 +-
net/sched/sch_qfq.c | 11 +-
sound/usb/format.c | 3 +-
65 files changed, 926 insertions(+), 505 deletions(-)
The quilt patch titled
Subject: x86/kexec: fix potential cmem->ranges out of bounds
has been removed from the -mm tree. Its filename was
x86-kexec-fix-potential-cmem-ranges-out-of-bounds.patch
This patch was dropped because an updated version will be issued
------------------------------------------------------
From: fuqiang wang <fuqiang.wang(a)easystack.cn>
Subject: x86/kexec: fix potential cmem->ranges out of bounds
Date: Mon, 8 Jan 2024 21:06:47 +0800
In memmap_exclude_ranges(), elfheader will be excluded from crashk_res.
In the current x86 architecture code, the elfheader is always allocated
at crashk_res.start. It seems that there won't be a new split range.
But it depends on the allocation position of elfheader in crashk_res. To
avoid potential out of bounds in future, add a extra slot.
The similar issue also exists in fill_up_crash_elf_data(). The range to
be excluded is [0, 1M], start (0) is special and will not appear in the
middle of existing cmem->ranges[]. But in cast the low 1M could be
changed in the future, add a extra slot too.
Without this patch, kdump kernel will fail to be loaded by
kexec_file_load,
[ 139.736948] UBSAN: array-index-out-of-bounds in arch/x86/kernel/crash.c:350:25
[ 139.742360] index 0 is out of range for type 'range [*]'
[ 139.745695] CPU: 0 UID: 0 PID: 5778 Comm: kexec Not tainted 6.15.0-0.rc3.20250425git02ddfb981de8.32.fc43.x86_64 #1 PREEMPT(lazy)
[ 139.745698] Hardware name: Amazon EC2 c5.large/, BIOS 1.0 10/16/2017
[ 139.745699] Call Trace:
[ 139.745700] <TASK>
[ 139.745701] dump_stack_lvl+0x5d/0x80
[ 139.745706] ubsan_epilogue+0x5/0x2b
[ 139.745709] __ubsan_handle_out_of_bounds.cold+0x54/0x59
[ 139.745711] crash_setup_memmap_entries+0x2d9/0x330
[ 139.745716] setup_boot_parameters+0xf8/0x6a0
[ 139.745720] bzImage64_load+0x41b/0x4e0
[ 139.745722] ? find_next_iomem_res+0x109/0x140
[ 139.745727] ? locate_mem_hole_callback+0x109/0x170
[ 139.745737] kimage_file_alloc_init+0x1ef/0x3e0
[ 139.745740] __do_sys_kexec_file_load+0x180/0x2f0
[ 139.745742] do_syscall_64+0x7b/0x160
[ 139.745745] ? do_user_addr_fault+0x21a/0x690
[ 139.745747] ? exc_page_fault+0x7e/0x1a0
[ 139.745749] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[ 139.745751] RIP: 0033:0x7f7712c84e4d
Previously discussed link:
[1] https://lore.kernel.org/kexec/ZXk2oBf%2FT1Ul6o0c@MiWiFi-R3L-srv/
[2] https://lore.kernel.org/kexec/273284e8-7680-4f5f-8065-c5d780987e59@easystac…
[3] https://lore.kernel.org/kexec/ZYQ6O%2F57sHAPxTHm@MiWiFi-R3L-srv/
Link: https://lkml.kernel.org/r/20240108130720.228478-1-fuqiang.wang@easystack.cn
Signed-off-by: fuqiang wang <fuqiang.wang(a)easystack.cn>
Acked-by: Baoquan He <bhe(a)redhat.com>
Reported-by: Coiby Xu <coxu(a)redhat.com>
Closes: https://lkml.kernel.org/r/4de3c2onosr7negqnfhekm4cpbklzmsimgdfv33c52dktqpza…
Cc: Vivek Goyal <vgoyal(a)redhat.com>
Cc: Dave Young <dyoung(a)redhat.com>
Cc: <x86(a)kernel.org>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
arch/x86/kernel/crash.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
--- a/arch/x86/kernel/crash.c~x86-kexec-fix-potential-cmem-ranges-out-of-bounds
+++ a/arch/x86/kernel/crash.c
@@ -165,8 +165,18 @@ static struct crash_mem *fill_up_crash_e
/*
* Exclusion of crash region and/or crashk_low_res may cause
* another range split. So add extra two slots here.
+ *
+ * Exclusion of low 1M may not cause another range split, because the
+ * range of exclude is [0, 1M] and the condition for splitting a new
+ * region is that the start, end parameters are both in a certain
+ * existing region in cmem and cannot be equal to existing region's
+ * start or end. Obviously, the start of [0, 1M] cannot meet this
+ * condition.
+ *
+ * But in order to lest the low 1M could be changed in the future,
+ * (e.g. [stare, 1M]), add a extra slot.
*/
- nr_ranges += 2;
+ nr_ranges += 3;
cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
if (!cmem)
return NULL;
@@ -298,9 +308,16 @@ int crash_setup_memmap_entries(struct ki
struct crash_memmap_data cmd;
struct crash_mem *cmem;
- cmem = vzalloc(struct_size(cmem, ranges, 1));
+ /*
+ * In the current x86 architecture code, the elfheader is always
+ * allocated at crashk_res.start. But it depends on the allocation
+ * position of elfheader in crashk_res. To avoid potential out of
+ * bounds in future, add a extra slot.
+ */
+ cmem = vzalloc(struct_size(cmem, ranges, 2));
if (!cmem)
return -ENOMEM;
+ cmem->max_nr_ranges = 2;
memset(&cmd, 0, sizeof(struct crash_memmap_data));
cmd.params = params;
_
Patches currently in -mm which might be from fuqiang.wang(a)easystack.cn are
From: Fabio Estevam <festevam(a)denx.de>
Since commit 2718f15403fb ("iio: sanity check available_scan_masks array"),
verbose and misleading warnings are printed for devices like the MAX11601:
max1363 1-0064: available_scan_mask 8 subset of 0. Never used
max1363 1-0064: available_scan_mask 9 subset of 0. Never used
max1363 1-0064: available_scan_mask 10 subset of 0. Never used
max1363 1-0064: available_scan_mask 11 subset of 0. Never used
max1363 1-0064: available_scan_mask 12 subset of 0. Never used
max1363 1-0064: available_scan_mask 13 subset of 0. Never used
...
[warnings continue]
Fix the available_scan_masks sanity check logic so that it
only prints the warning when an element of available_scan_mask
is in fact a subset of a previous one.
These warnings incorrectly report that later scan masks are subsets of
the first one, even when they are not. The issue lies in the logic that
checks for subset relationships between scan masks.
Fix the subset detection to correctly compare each mask only
against previous masks, and only warn when a true subset is found.
With this fix, the warning output becomes both correct and more
informative:
max1363 1-0064: Mask 7 (0xc) is a subset of mask 6 (0xf) and will be ignored
Cc: stable(a)vger.kernel.org
Fixes: 2718f15403fb ("iio: sanity check available_scan_masks array")
Signed-off-by: Fabio Estevam <festevam(a)denx.de>
---
drivers/iio/industrialio-core.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 6a6568d4a2cb..855d5fd3e6b2 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -1904,6 +1904,11 @@ static int iio_check_extended_name(const struct iio_dev *indio_dev)
static const struct iio_buffer_setup_ops noop_ring_setup_ops;
+static int is_subset(unsigned long a, unsigned long b)
+{
+ return (a & ~b) == 0;
+}
+
static void iio_sanity_check_avail_scan_masks(struct iio_dev *indio_dev)
{
unsigned int num_masks, masklength, longs_per_mask;
@@ -1947,21 +1952,13 @@ static void iio_sanity_check_avail_scan_masks(struct iio_dev *indio_dev)
* available masks in the order of preference (presumably the least
* costy to access masks first).
*/
- for (i = 0; i < num_masks - 1; i++) {
- const unsigned long *mask1;
- int j;
- mask1 = av_masks + i * longs_per_mask;
- for (j = i + 1; j < num_masks; j++) {
- const unsigned long *mask2;
-
- mask2 = av_masks + j * longs_per_mask;
- if (bitmap_subset(mask2, mask1, masklength))
+ for (i = 1; i < num_masks; ++i)
+ for (int j = 0; j < i; ++j)
+ if (is_subset(av_masks[i], av_masks[j]))
dev_warn(indio_dev->dev.parent,
- "available_scan_mask %d subset of %d. Never used\n",
- j, i);
- }
- }
+ "Mask %d (0x%lx) is a subset of mask %d (0x%lx) and will be ignored\n",
+ i, av_masks[i], j, av_masks[j]);
}
/**
--
2.34.1
The original PPTT code had a bug where the processor subtable length
was not correctly validated when encountering a truncated
acpi_pptt_processor node.
Commit 7ab4f0e37a0f4 ("ACPI PPTT: Fix coding mistakes in a couple of
sizeof() calls") attempted to fix this by validating the size is as
large as the acpi_pptt_processor node structure. This introduced a
regression where the last processor node in the PPTT table is ignored
if it doesn't contain any private resources. That results errors like:
ACPI PPTT: PPTT table found, but unable to locate core XX (XX)
ACPI: SPE must be homogeneous
Furthermore, it fail in a common case where the node length isn't
equal to the acpi_pptt_processor structure size, leaving the original
bug in a modified form.
Correct the regression by adjusting the loop termination conditions as
suggested by the bug reporters. An additional check performed after
the subtable node type is detected, validates the acpi_pptt_processor
node is fully contained in the PPTT table. Repeating the check in
acpi_pptt_leaf_node() is largely redundant as the node is already
known to be fully contained in the table.
The case where a final truncated node's parent property is accepted,
but the node itself is rejected should not be considered a bug.
Fixes: 7ab4f0e37a0f4 ("ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls")
Reported-by: Maximilian Heyne <mheyne(a)amazon.de>
Closes: https://lore.kernel.org/linux-acpi/20250506-draco-taped-15f475cd@mheyne-ama…
Reported-by: Yicong Yang <yangyicong(a)hisilicon.com>
Closes: https://lore.kernel.org/linux-acpi/20250507035124.28071-1-yangyicong@huawei…
Signed-off-by: Jeremy Linton <jeremy.linton(a)arm.com>
Cc: Jean-Marc Eurin <jmeurin(a)google.com>
Cc: <stable(a)vger.kernel.org>
---
drivers/acpi/pptt.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index f73ce6e13065..54676e3d82dd 100644
--- a/drivers/acpi/pptt.c
+++ b/drivers/acpi/pptt.c
@@ -231,16 +231,18 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr,
sizeof(struct acpi_table_pptt));
proc_sz = sizeof(struct acpi_pptt_processor);
- while ((unsigned long)entry + proc_sz < table_end) {
+ /* ignore subtable types that are smaller than a processor node */
+ while ((unsigned long)entry + proc_sz <= table_end) {
cpu_node = (struct acpi_pptt_processor *)entry;
+
if (entry->type == ACPI_PPTT_TYPE_PROCESSOR &&
cpu_node->parent == node_entry)
return 0;
if (entry->length == 0)
return 0;
+
entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry,
entry->length);
-
}
return 1;
}
@@ -273,15 +275,18 @@ static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he
proc_sz = sizeof(struct acpi_pptt_processor);
/* find the processor structure associated with this cpuid */
- while ((unsigned long)entry + proc_sz < table_end) {
+ while ((unsigned long)entry + proc_sz <= table_end) {
cpu_node = (struct acpi_pptt_processor *)entry;
if (entry->length == 0) {
pr_warn("Invalid zero length subtable\n");
break;
}
+ /* entry->length may not equal proc_sz, revalidate the processor structure length */
if (entry->type == ACPI_PPTT_TYPE_PROCESSOR &&
acpi_cpu_id == cpu_node->acpi_processor_id &&
+ (unsigned long)entry + entry->length <= table_end &&
+ entry->length == proc_sz + cpu_node->number_of_priv_resources * sizeof(u32) &&
acpi_pptt_leaf_node(table_hdr, cpu_node)) {
return (struct acpi_pptt_processor *)entry;
}
--
2.49.0
Hi,
On 3/14/25 2:08 PM, Benjamin Berg wrote:
> From: Benjamin Berg <benjamin.berg(a)intel.com>
> um: work around sched_yield not yielding in time-travel mode
>
> sched_yield by a userspace may not actually cause scheduling in
> time-travel mode as no time has passed. In the case seen it appears to
> be a badly implemented userspace spinlock in ASAN. Unfortunately, with
> time-travel it causes an extreme slowdown or even deadlock depending on
> the kernel configuration (CONFIG_UML_MAX_USERSPACE_ITERATIONS).
>
> Work around it by accounting time to the process whenever it executes a
> sched_yield syscall.
>
> Signed-off-by: Benjamin Berg <benjamin.berg(a)intel.com>
From what I can tell the patch mentioned above was backported to 6.12.27 by:
<https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arc…>
but without the upstream
|Commit 0b8b2668f9981c1fefc2ef892bd915288ef01f33
|Author: Benjamin Berg <benjamin.berg(a)intel.com>
|Date: Thu Oct 10 16:25:37 2024 +0200
| um: insert scheduler ticks when userspace does not yield
|
| In time-travel mode userspace can do a lot of work without any time
| passing. Unfortunately, this can result in OOM situations as the RCU
| core code will never be run. [...]
the kernel build for 6.12.27 for the UM-Target will fail:
| /usr/bin/ld: arch/um/kernel/skas/syscall.o: in function `handle_syscall': linux-6.12.27/arch/um/kernel/skas/syscall.c:43:(.text+0xa2): undefined reference to `tt_extra_sched_jiffies'
| collect2: error: ld returned 1 exit status
is it possible to backport 0b8b2668f9981c1fefc2ef892bd915288ef01f33 too?
Or is it better to revert 887c5c12e80c8424bd471122d2e8b6b462e12874 again
in the stable releases?
Best Regards,
Christian Lamparter
>
> ---
>
> I suspect it is this code in ASAN that uses sched_yield
> https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/sanitizer_co…
> though there are also some other places that use sched_yield.
>
> I doubt that code is reasonable. At the same time, not sure that
> sched_yield is behaving as advertised either as it obviously is not
> necessarily relinquishing the CPU.
> ---
> arch/um/include/linux/time-internal.h | 2 ++
> arch/um/kernel/skas/syscall.c | 11 +++++++++++
> 2 files changed, 13 insertions(+)
>
> diff --git a/arch/um/include/linux/time-internal.h b/arch/um/include/linux/time-internal.h
> index b22226634ff6..138908b999d7 100644
> --- a/arch/um/include/linux/time-internal.h
> +++ b/arch/um/include/linux/time-internal.h
> @@ -83,6 +83,8 @@ extern void time_travel_not_configured(void);
> #define time_travel_del_event(...) time_travel_not_configured()
> #endif /* CONFIG_UML_TIME_TRAVEL_SUPPORT */
>
> +extern unsigned long tt_extra_sched_jiffies;
> +
> /*
> * Without CONFIG_UML_TIME_TRAVEL_SUPPORT this is a linker error if used,
> * which is intentional since we really shouldn't link it in that case.
> diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c
> index b09e85279d2b..a5beaea2967e 100644
> --- a/arch/um/kernel/skas/syscall.c
> +++ b/arch/um/kernel/skas/syscall.c
> @@ -31,6 +31,17 @@ void handle_syscall(struct uml_pt_regs *r)
> goto out;
>
> syscall = UPT_SYSCALL_NR(r);
> +
> + /*
> + * If no time passes, then sched_yield may not actually yield, causing
> + * broken spinlock implementations in userspace (ASAN) to hang for long
> + * periods of time.
> + */
> + if ((time_travel_mode == TT_MODE_INFCPU ||
> + time_travel_mode == TT_MODE_EXTERNAL) &&
> + syscall == __NR_sched_yield)
> + tt_extra_sched_jiffies += 1;
> +
> if (syscall >= 0 && syscall < __NR_syscalls) {
> unsigned long ret = EXECUTE_SYSCALL(syscall, regs);
>