* [PATCH 6.18 00/43] 6.18.13-rc1 review
@ 2026-02-17 20:31 Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 01/43] scsi: qla2xxx: Fix bsg_done() causing double free Greg Kroah-Hartman
` (52 more replies)
0 siblings, 53 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
This is the start of the stable review cycle for the 6.18.13 release.
There are 43 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 Thu, 19 Feb 2026 19:59:50 +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/v6.x/stable-review/patch-6.18.13-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 6.18.13-rc1
Chao Yu <chao@kernel.org>
f2fs: fix to do sanity check on node footer in {read,write}_end_io
Chao Yu <chao@kernel.org>
f2fs: fix to do sanity check on node footer in __write_node_folio()
Fabio Porcedda <fabio.porcedda@gmail.com>
USB: serial: option: add Telit FN920C04 RNDIS compositions
Danilo Krummrich <dakr@kernel.org>
iommu/arm-smmu-qcom: do not register driver in probe()
Yeongjin Gil <youngjin.gil@samsung.com>
f2fs: optimize f2fs_overwrite_io() for f2fs_iomap_begin
Chao Yu <chao@kernel.org>
f2fs: fix to avoid mapping wrong physical block for swapfile
Daeho Jeong <daehojeong@google.com>
f2fs: support non-4KB block size without packed_ssa feature
Chao Yu <chao@kernel.org>
f2fs: fix to avoid UAF in f2fs_write_end_io()
Yongpeng Yang <yangyongpeng@xiaomi.com>
f2fs: fix out-of-bounds access in sysfs attribute read/write
Yongpeng Yang <yangyongpeng@xiaomi.com>
f2fs: fix IS_CHECKPOINTED flag inconsistency issue caused by concurrent atomic commit and checkpoint writes
Chao Yu <chao@kernel.org>
f2fs: fix to check sysfs filename w/ gc_pin_file_thresh correctly
Zhiguo Niu <zhiguo.niu@unisoc.com>
f2fs: fix to add gc count stat in f2fs_gc_range
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fbdev: smscufx: properly copy ioctl memory to kernelspace
Guangshuo Li <lgs201920130244@gmail.com>
fbdev: rivafb: fix divide error in nv3_arb()
Chen Ridong <chenridong@huawei.com>
cpuset: Fix missing adaptation for cpuset_is_populated
Tiezhu Yang <yangtiezhu@loongson.cn>
LoongArch: Rework KASAN initialization for PTW-enabled systems
David Hildenbrand (Red Hat) <david@kernel.org>
mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather
Otto Pflüger <otto.pflueger@abscue.de>
arm64: dts: mediatek: mt8183: Add missing endpoint IDs to display graph
Alban Bedel <alban.bedel@lht.dlh.de>
gpiolib: acpi: Fix gpio count with string references
Jens Axboe <axboe@kernel.dk>
io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs
Ziyi Guo <n7l8m4@u.northwestern.edu>
ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()
Melissa Wen <mwen@igalia.com>
drm/amd/display: remove assert around dpp_base replacement
Melissa Wen <mwen@igalia.com>
drm/amd/display: extend delta clamping logic to CM3 LUT helper
Deepanshu Kartikey <kartikey406@gmail.com>
tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow
Charles Keepax <ckeepax@opensource.cirrus.com>
ASoC: cs42l43: Correct handling of 3-pole jack load detection
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
platform/x86: panasonic-laptop: Fix sysfs group leak in error path
Maciej Strozek <mstrozek@opensource.cirrus.com>
ASoC: sof_sdw: Add a quirk for Lenovo laptop using sidecar amps with cs42l43
gongqi <550230171hxy@gmail.com>
platform/x86/amd/pmc: Add quirk for MECHREVO Wujie 15X Pro
Breno Baptista <brenomb07@gmail.com>
ALSA: hda/realtek: Enable headset mic for Acer Nitro 5
Dirk Su <dirk.su@canonical.com>
ASoC: amd: yc: Add quirk for HP 200 G2a 16
Tagir Garaev <tgaraev653@gmail.com>
ASoC: Intel: sof_es8336: Add DMI quirk for Huawei BOD-WXX9
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
platform/x86: classmate-laptop: Add missing NULL pointer checks
Brahmajit Das <listout@listout.xyz>
drm/tegra: hdmi: sor: Fix error: variable ‘j’ set but not used
Deepanshu Kartikey <kartikey406@gmail.com>
romfs: check sb_set_blocksize() return value
Kailang Yang <kailang@realtek.com>
ALSA: hda/realtek - fixed speaker no sound
Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
ASoC: cs35l45: Corrects ASP_TX5 DAPM widget channel
Zhang Heng <zhangheng@kylinos.cn>
ALSA: hda/realtek: Add quirk for Inspur S14-G1
Xuewen Yan <xuewen.yan@unisoc.com>
gpio: sprd: Change sprd_gpio lock to raw_spin_lock
Anatolii Shirykalov <pipocavsobake@gmail.com>
ASoC: amd: yc: Add ASUS ExpertBook PM1503CDA to quirks list
Alice Ryhl <aliceryhl@google.com>
rust: driver: fix broken intra-doc links to example driver types
FUJITA Tomonori <fujita.tomonori@gmail.com>
rust: dma: fix broken intra-doc links
FUJITA Tomonori <fujita.tomonori@gmail.com>
rust: device: fix broken intra-doc links
Anil Gurumurthy <agurumurthy@marvell.com>
scsi: qla2xxx: Fix bsg_done() causing double free
-------------
Diffstat:
Makefile | 4 +-
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 37 ++++++-
arch/loongarch/mm/kasan_init.c | 80 +++++++-------
drivers/gpio/gpio-sprd.c | 8 +-
drivers/gpio/gpiolib-acpi-core.c | 1 +
.../gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c | 30 ++++-
.../drm/amd/display/dc/dwb/dcn30/dcn30_cm_common.h | 2 +-
.../drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 9 +-
.../drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 18 +--
.../drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 16 +--
drivers/gpu/drm/tegra/hdmi.c | 4 +-
drivers/gpu/drm/tegra/sor.c | 4 +-
drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 14 +++
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 14 ++-
drivers/iommu/arm/arm-smmu/arm-smmu.c | 24 +++-
drivers/iommu/arm/arm-smmu/arm-smmu.h | 5 +
drivers/platform/x86/amd/pmc/pmc-quirks.c | 7 ++
drivers/platform/x86/classmate-laptop.c | 32 ++++++
drivers/platform/x86/panasonic-laptop.c | 4 +-
drivers/scsi/qla2xxx/qla_bsg.c | 28 +++--
drivers/usb/serial/option.c | 6 +
drivers/video/fbdev/riva/riva_hw.c | 3 +
drivers/video/fbdev/smscufx.c | 8 +-
fs/f2fs/data.c | 51 ++++++---
fs/f2fs/f2fs.h | 64 ++++++++---
fs/f2fs/gc.c | 24 ++--
fs/f2fs/node.c | 50 +++++----
fs/f2fs/node.h | 8 --
fs/f2fs/recovery.c | 6 +-
fs/f2fs/segment.c | 86 +++++++-------
fs/f2fs/segment.h | 9 +-
fs/f2fs/super.c | 26 ++---
fs/f2fs/sysfs.c | 62 +++++++++--
fs/romfs/super.c | 5 +-
include/asm-generic/tlb.h | 77 ++++++++++++-
include/linux/f2fs_fs.h | 73 +++++++-----
include/linux/hugetlb.h | 15 ++-
include/linux/mm_types.h | 1 +
include/trace/events/dma.h | 25 ++++-
io_uring/fdinfo.c | 11 +-
kernel/cgroup/cpuset.c | 2 +-
mm/hugetlb.c | 123 ++++++++++++---------
mm/mmu_gather.c | 33 ++++++
mm/rmap.c | 25 +++--
rust/kernel/device.rs | 6 +-
rust/kernel/dma.rs | 5 +-
rust/kernel/driver.rs | 12 +-
sound/hda/codecs/realtek/alc269.c | 13 +++
sound/soc/amd/yc/acp6x-mach.c | 14 +++
sound/soc/codecs/cs35l45.c | 2 +-
sound/soc/codecs/cs42l43-jack.c | 37 ++++++-
sound/soc/fsl/fsl_xcvr.c | 3 +
sound/soc/intel/boards/sof_es8336.c | 9 ++
sound/soc/intel/boards/sof_sdw.c | 1 +
54 files changed, 877 insertions(+), 359 deletions(-)
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 01/43] scsi: qla2xxx: Fix bsg_done() causing double free
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 02/43] rust: device: fix broken intra-doc links Greg Kroah-Hartman
` (51 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anil Gurumurthy, Nilesh Javali,
Himanshu Madhani, Martin K. Petersen, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anil Gurumurthy <agurumurthy@marvell.com>
commit c2c68225b1456f4d0d393b5a8778d51bb0d5b1d0 upstream.
Kernel panic observed on system,
[5353358.825191] BUG: unable to handle page fault for address: ff5f5e897b024000
[5353358.825194] #PF: supervisor write access in kernel mode
[5353358.825195] #PF: error_code(0x0002) - not-present page
[5353358.825196] PGD 100006067 P4D 0
[5353358.825198] Oops: 0002 [#1] PREEMPT SMP NOPTI
[5353358.825200] CPU: 5 PID: 2132085 Comm: qlafwupdate.sub Kdump: loaded Tainted: G W L ------- --- 5.14.0-503.34.1.el9_5.x86_64 #1
[5353358.825203] Hardware name: HPE ProLiant DL360 Gen11/ProLiant DL360 Gen11, BIOS 2.44 01/17/2025
[5353358.825204] RIP: 0010:memcpy_erms+0x6/0x10
[5353358.825211] RSP: 0018:ff591da8f4f6b710 EFLAGS: 00010246
[5353358.825212] RAX: ff5f5e897b024000 RBX: 0000000000007090 RCX: 0000000000001000
[5353358.825213] RDX: 0000000000001000 RSI: ff591da8f4fed090 RDI: ff5f5e897b024000
[5353358.825214] RBP: 0000000000010000 R08: ff5f5e897b024000 R09: 0000000000000000
[5353358.825215] R10: ff46cf8c40517000 R11: 0000000000000001 R12: 0000000000008090
[5353358.825216] R13: ff591da8f4f6b720 R14: 0000000000001000 R15: 0000000000000000
[5353358.825218] FS: 00007f1e88d47740(0000) GS:ff46cf935f940000(0000) knlGS:0000000000000000
[5353358.825219] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[5353358.825220] CR2: ff5f5e897b024000 CR3: 0000000231532004 CR4: 0000000000771ef0
[5353358.825221] PKRU: 55555554
[5353358.825222] Call Trace:
[5353358.825223] <TASK>
[5353358.825224] ? show_trace_log_lvl+0x1c4/0x2df
[5353358.825229] ? show_trace_log_lvl+0x1c4/0x2df
[5353358.825232] ? sg_copy_buffer+0xc8/0x110
[5353358.825236] ? __die_body.cold+0x8/0xd
[5353358.825238] ? page_fault_oops+0x134/0x170
[5353358.825242] ? kernelmode_fixup_or_oops+0x84/0x110
[5353358.825244] ? exc_page_fault+0xa8/0x150
[5353358.825247] ? asm_exc_page_fault+0x22/0x30
[5353358.825252] ? memcpy_erms+0x6/0x10
[5353358.825253] sg_copy_buffer+0xc8/0x110
[5353358.825259] qla2x00_process_vendor_specific+0x652/0x1320 [qla2xxx]
[5353358.825317] qla24xx_bsg_request+0x1b2/0x2d0 [qla2xxx]
Most routines in qla_bsg.c call bsg_done() only for success cases.
However a few invoke it for failure case as well leading to a double
free. Validate before calling bsg_done().
Cc: stable@vger.kernel.org
Signed-off-by: Anil Gurumurthy <agurumurthy@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani2024@gmail.com>
Link: https://patch.msgid.link/20251210101604.431868-12-njavali@marvell.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/qla2xxx/qla_bsg.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -1546,8 +1546,9 @@ qla2x00_update_optrom(struct bsg_job *bs
ha->optrom_buffer = NULL;
ha->optrom_state = QLA_SWAITING;
mutex_unlock(&ha->optrom_mutex);
- bsg_job_done(bsg_job, bsg_reply->result,
- bsg_reply->reply_payload_rcv_len);
+ if (!rval)
+ bsg_job_done(bsg_job, bsg_reply->result,
+ bsg_reply->reply_payload_rcv_len);
return rval;
}
@@ -2612,8 +2613,9 @@ qla2x00_manage_host_stats(struct bsg_job
sizeof(struct ql_vnd_mng_host_stats_resp));
bsg_reply->result = DID_OK;
- bsg_job_done(bsg_job, bsg_reply->result,
- bsg_reply->reply_payload_rcv_len);
+ if (!ret)
+ bsg_job_done(bsg_job, bsg_reply->result,
+ bsg_reply->reply_payload_rcv_len);
return ret;
}
@@ -2702,8 +2704,9 @@ qla2x00_get_host_stats(struct bsg_job *b
bsg_job->reply_payload.sg_cnt,
data, response_len);
bsg_reply->result = DID_OK;
- bsg_job_done(bsg_job, bsg_reply->result,
- bsg_reply->reply_payload_rcv_len);
+ if (!ret)
+ bsg_job_done(bsg_job, bsg_reply->result,
+ bsg_reply->reply_payload_rcv_len);
kfree(data);
host_stat_out:
@@ -2802,8 +2805,9 @@ reply:
bsg_job->reply_payload.sg_cnt, data,
response_len);
bsg_reply->result = DID_OK;
- bsg_job_done(bsg_job, bsg_reply->result,
- bsg_reply->reply_payload_rcv_len);
+ if (!ret)
+ bsg_job_done(bsg_job, bsg_reply->result,
+ bsg_reply->reply_payload_rcv_len);
tgt_stat_out:
kfree(data);
@@ -2864,8 +2868,9 @@ qla2x00_manage_host_port(struct bsg_job
bsg_job->reply_payload.sg_cnt, &rsp_data,
sizeof(struct ql_vnd_mng_host_port_resp));
bsg_reply->result = DID_OK;
- bsg_job_done(bsg_job, bsg_reply->result,
- bsg_reply->reply_payload_rcv_len);
+ if (!ret)
+ bsg_job_done(bsg_job, bsg_reply->result,
+ bsg_reply->reply_payload_rcv_len);
return ret;
}
@@ -3240,7 +3245,8 @@ int qla2x00_mailbox_passthru(struct bsg_
bsg_job->reply_len = sizeof(*bsg_job->reply);
bsg_reply->result = DID_OK << 16;
- bsg_job_done(bsg_job, bsg_reply->result, bsg_reply->reply_payload_rcv_len);
+ if (!ret)
+ bsg_job_done(bsg_job, bsg_reply->result, bsg_reply->reply_payload_rcv_len);
kfree(req_data);
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 02/43] rust: device: fix broken intra-doc links
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 01/43] scsi: qla2xxx: Fix bsg_done() causing double free Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 03/43] rust: dma: " Greg Kroah-Hartman
` (50 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, FUJITA Tomonori, Dirk Behme,
Danilo Krummrich
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: FUJITA Tomonori <fujita.tomonori@gmail.com>
commit a9a42f0754b6c69525612d678b73da790e28b9fd upstream.
The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
intra-doc link to `pci::Device` causes rustdoc warnings:
warning: unresolved link to `kernel::pci::Device`
--> rust/kernel/device.rs:163:22
|
163 | /// [`pci::Device`]: kernel::pci::Device
| ^^^^^^^^^^^^^^^^^^^ no item named `pci` in module `kernel`
|
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
Fix this by making the documentation conditional on CONFIG_PCI.
Fixes: d6e26c1ae4a6 ("device: rust: expand documentation for Device")
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>
Link: https://patch.msgid.link/20251231045728.1912024-2-fujita.tomonori@gmail.com
[ Keep the "such as" part indicating a list of examples; fix typos in
commit message. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
rust/kernel/device.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -62,8 +62,9 @@ pub mod property;
///
/// # Implementing Bus Devices
///
-/// This section provides a guideline to implement bus specific devices, such as [`pci::Device`] or
-/// [`platform::Device`].
+/// This section provides a guideline to implement bus specific devices, such as:
+#[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")]
+/// * [`platform::Device`]
///
/// A bus specific device should be defined as follows.
///
@@ -155,7 +156,6 @@ pub mod property;
///
/// [`AlwaysRefCounted`]: kernel::types::AlwaysRefCounted
/// [`impl_device_context_deref`]: kernel::impl_device_context_deref
-/// [`pci::Device`]: kernel::pci::Device
/// [`platform::Device`]: kernel::platform::Device
#[repr(transparent)]
pub struct Device<Ctx: DeviceContext = Normal>(Opaque<bindings::device>, PhantomData<Ctx>);
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 03/43] rust: dma: fix broken intra-doc links
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 01/43] scsi: qla2xxx: Fix bsg_done() causing double free Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 02/43] rust: device: fix broken intra-doc links Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 04/43] rust: driver: fix broken intra-doc links to example driver types Greg Kroah-Hartman
` (49 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, FUJITA Tomonori, Dirk Behme,
Danilo Krummrich
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: FUJITA Tomonori <fujita.tomonori@gmail.com>
commit 32cb3840386fd3684fbe8294cfc0a6684417139e upstream.
The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
intra-doc link to `pci::Device` causes rustdoc warnings:
warning: unresolved link to `::kernel::pci::Device`
--> rust/kernel/dma.rs:30:70
|
30 | /// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or
| ^^^^^^^^^^^^^^^^^^^^^ no item named `pci` in module `kernel`
Fix this by making the documentation conditional on CONFIG_PCI.
Fixes: d06d5f66f549 ("rust: dma: implement `dma::Device` trait")
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>
Link: https://patch.msgid.link/20251231045728.1912024-1-fujita.tomonori@gmail.com
[ Keep the "such as" part indicating a list of examples; fix typos in
commit message. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
rust/kernel/dma.rs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/rust/kernel/dma.rs
+++ b/rust/kernel/dma.rs
@@ -26,8 +26,9 @@ pub type DmaAddress = bindings::dma_addr
/// Trait to be implemented by DMA capable bus devices.
///
/// The [`dma::Device`](Device) trait should be implemented by bus specific device representations,
-/// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or
-/// [`platform::Device`](::kernel::platform::Device).
+/// where the underlying bus is DMA capable, such as:
+#[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")]
+/// * [`platform::Device`](::kernel::platform::Device)
pub trait Device: AsRef<device::Device<Core>> {
/// Set up the device's DMA streaming addressing capabilities.
///
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 04/43] rust: driver: fix broken intra-doc links to example driver types
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 03/43] rust: dma: " Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 05/43] ASoC: amd: yc: Add ASUS ExpertBook PM1503CDA to quirks list Greg Kroah-Hartman
` (48 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alice Ryhl, FUJITA Tomonori,
Danilo Krummrich
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alice Ryhl <aliceryhl@google.com>
commit 4c9f6a782f6078dc94450fcb22e65d520bfa0775 upstream.
The `auxiliary` and `pci` modules are conditional on
`CONFIG_AUXILIARY_BUS` and `CONFIG_PCI` respectively. When these are
disabled, the intra-doc links to `auxiliary::Driver` and `pci::Driver`
break, causing rustdoc warnings (or errors with `-D warnings`).
error: unresolved link to `kernel::auxiliary::Driver`
--> rust/kernel/driver.rs:82:28
|
82 | //! [`auxiliary::Driver`]: kernel::auxiliary::Driver
| ^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `auxiliary` in module `kernel`
Fix this by making the documentation for these examples conditional on
the corresponding configuration options.
Fixes: 970a7c68788e ("driver: rust: expand documentation for driver infrastructure")
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Closes: https://lore.kernel.org/rust-for-linux/20251209.151817.744108529426448097.fujita.tomonori@gmail.com/
Link: https://patch.msgid.link/20251227-driver-types-v1-1-1916154fbe5e@google.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
rust/kernel/driver.rs | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/rust/kernel/driver.rs
+++ b/rust/kernel/driver.rs
@@ -33,7 +33,14 @@
//! }
//! ```
//!
-//! For specific examples see [`auxiliary::Driver`], [`pci::Driver`] and [`platform::Driver`].
+//! For specific examples see:
+//!
+//! * [`platform::Driver`](kernel::platform::Driver)
+#"
+)]
+#")]
//!
//! The `probe()` callback should return a `Result<Pin<KBox<Self>>>`, i.e. the driver's private
//! data. The bus abstraction should store the pointer in the corresponding bus device. The generic
@@ -79,7 +86,6 @@
//!
//! For this purpose the generic infrastructure in [`device_id`] should be used.
//!
-//! [`auxiliary::Driver`]: kernel::auxiliary::Driver
//! [`Core`]: device::Core
//! [`Device`]: device::Device
//! [`Device<Core>`]: device::Device<device::Core>
@@ -87,8 +93,6 @@
//! [`DeviceContext`]: device::DeviceContext
//! [`device_id`]: kernel::device_id
//! [`module_driver`]: kernel::module_driver
-//! [`pci::Driver`]: kernel::pci::Driver
-//! [`platform::Driver`]: kernel::platform::Driver
use crate::error::{Error, Result};
use crate::{acpi, device, of, str::CStr, try_pin_init, types::Opaque, ThisModule};
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 05/43] ASoC: amd: yc: Add ASUS ExpertBook PM1503CDA to quirks list
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 04/43] rust: driver: fix broken intra-doc links to example driver types Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 06/43] gpio: sprd: Change sprd_gpio lock to raw_spin_lock Greg Kroah-Hartman
` (47 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anatolii Shirykalov, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anatolii Shirykalov <pipocavsobake@gmail.com>
[ Upstream commit 018b211b1d321a52ed8d8de74ce83ce52a2e1224 ]
Add ASUS ExpertBook PM1503CDA to the DMI quirks table to enable
internal DMIC support via the ACP6x machine driver.
Signed-off-by: Anatolii Shirykalov <pipocavsobake@gmail.com>
Link: https://patch.msgid.link/20260119145618.3171435-1-pipocavsobake@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/yc/acp6x-mach.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index c4a4a06528b45..c18da0915baad 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -542,6 +542,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "15NBC1011"),
}
},
+ {
+ .driver_data = &acp6x_card,
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK PM1503CDA"),
+ }
+ },
{
.driver_data = &acp6x_card,
.matches = {
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 06/43] gpio: sprd: Change sprd_gpio lock to raw_spin_lock
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 05/43] ASoC: amd: yc: Add ASUS ExpertBook PM1503CDA to quirks list Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 07/43] ALSA: hda/realtek: Add quirk for Inspur S14-G1 Greg Kroah-Hartman
` (46 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xuewen Yan, Baolin Wang,
Sebastian Andrzej Siewior, Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xuewen Yan <xuewen.yan@unisoc.com>
[ Upstream commit 96313fcc1f062ba239f4832c9eff685da6c51c99 ]
There was a lockdep warning in sprd_gpio:
[ 6.258269][T329@C6] [ BUG: Invalid wait context ]
[ 6.258270][T329@C6] 6.18.0-android17-0-g30527ad7aaae-ab00009-4k #1 Tainted: G W OE
[ 6.258272][T329@C6] -----------------------------
[ 6.258273][T329@C6] modprobe/329 is trying to lock:
[ 6.258275][T329@C6] ffffff8081c91690 (&sprd_gpio->lock){....}-{3:3}, at: sprd_gpio_irq_unmask+0x4c/0xa4 [gpio_sprd]
[ 6.258282][T329@C6] other info that might help us debug this:
[ 6.258283][T329@C6] context-{5:5}
[ 6.258285][T329@C6] 3 locks held by modprobe/329:
[ 6.258286][T329@C6] #0: ffffff808baca108 (&dev->mutex){....}-{4:4}, at: __driver_attach+0xc4/0x204
[ 6.258295][T329@C6] #1: ffffff80965e7240 (request_class#4){+.+.}-{4:4}, at: __setup_irq+0x1cc/0x82c
[ 6.258304][T329@C6] #2: ffffff80965e70c8 (lock_class#4){....}-{2:2}, at: __setup_irq+0x21c/0x82c
[ 6.258313][T329@C6] stack backtrace:
[ 6.258314][T329@C6] CPU: 6 UID: 0 PID: 329 Comm: modprobe Tainted: G W OE 6.18.0-android17-0-g30527ad7aaae-ab00009-4k #1 PREEMPT 3ad5b0f45741a16e5838da790706e16ceb6717df
[ 6.258316][T329@C6] Tainted: [W]=WARN, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[ 6.258317][T329@C6] Hardware name: Unisoc UMS9632-base Board (DT)
[ 6.258318][T329@C6] Call trace:
[ 6.258318][T329@C6] show_stack+0x20/0x30 (C)
[ 6.258321][T329@C6] __dump_stack+0x28/0x3c
[ 6.258324][T329@C6] dump_stack_lvl+0xac/0xf0
[ 6.258326][T329@C6] dump_stack+0x18/0x3c
[ 6.258329][T329@C6] __lock_acquire+0x824/0x2c28
[ 6.258331][T329@C6] lock_acquire+0x148/0x2cc
[ 6.258333][T329@C6] _raw_spin_lock_irqsave+0x6c/0xb4
[ 6.258334][T329@C6] sprd_gpio_irq_unmask+0x4c/0xa4 [gpio_sprd 814535e93c6d8e0853c45c02eab0fa88a9da6487]
[ 6.258337][T329@C6] irq_startup+0x238/0x350
[ 6.258340][T329@C6] __setup_irq+0x504/0x82c
[ 6.258342][T329@C6] request_threaded_irq+0x118/0x184
[ 6.258344][T329@C6] devm_request_threaded_irq+0x94/0x120
[ 6.258347][T329@C6] sc8546_init_irq+0x114/0x170 [sc8546_charger 223586ccafc27439f7db4f95b0c8e6e882349a99]
[ 6.258352][T329@C6] sc8546_charger_probe+0x53c/0x5a0 [sc8546_charger 223586ccafc27439f7db4f95b0c8e6e882349a99]
[ 6.258358][T329@C6] i2c_device_probe+0x2c8/0x350
[ 6.258361][T329@C6] really_probe+0x1a8/0x46c
[ 6.258363][T329@C6] __driver_probe_device+0xa4/0x10c
[ 6.258366][T329@C6] driver_probe_device+0x44/0x1b4
[ 6.258369][T329@C6] __driver_attach+0xd0/0x204
[ 6.258371][T329@C6] bus_for_each_dev+0x10c/0x168
[ 6.258373][T329@C6] driver_attach+0x2c/0x3c
[ 6.258376][T329@C6] bus_add_driver+0x154/0x29c
[ 6.258378][T329@C6] driver_register+0x70/0x10c
[ 6.258381][T329@C6] i2c_register_driver+0x48/0xc8
[ 6.258384][T329@C6] init_module+0x28/0xfd8 [sc8546_charger 223586ccafc27439f7db4f95b0c8e6e882349a99]
[ 6.258389][T329@C6] do_one_initcall+0x128/0x42c
[ 6.258392][T329@C6] do_init_module+0x60/0x254
[ 6.258395][T329@C6] load_module+0x1054/0x1220
[ 6.258397][T329@C6] __arm64_sys_finit_module+0x240/0x35c
[ 6.258400][T329@C6] invoke_syscall+0x60/0xec
[ 6.258402][T329@C6] el0_svc_common+0xb0/0xe4
[ 6.258405][T329@C6] do_el0_svc+0x24/0x30
[ 6.258407][T329@C6] el0_svc+0x54/0x1c4
[ 6.258409][T329@C6] el0t_64_sync_handler+0x68/0xdc
[ 6.258411][T329@C6] el0t_64_sync+0x1c4/0x1c8
This is because the spin_lock would change to rt_mutex in PREEMPT_RT,
however the sprd_gpio->lock would use in hard-irq, this is unsafe.
So change the spin_lock_t to raw_spin_lock_t to use the spinlock
in hard-irq.
Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20260126094209.9855-1-xuewen.yan@unisoc.com
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-sprd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
index 413bcd0a42405..2cc8abe705cdb 100644
--- a/drivers/gpio/gpio-sprd.c
+++ b/drivers/gpio/gpio-sprd.c
@@ -35,7 +35,7 @@
struct sprd_gpio {
struct gpio_chip chip;
void __iomem *base;
- spinlock_t lock;
+ raw_spinlock_t lock;
int irq;
};
@@ -54,7 +54,7 @@ static void sprd_gpio_update(struct gpio_chip *chip, unsigned int offset,
unsigned long flags;
u32 tmp;
- spin_lock_irqsave(&sprd_gpio->lock, flags);
+ raw_spin_lock_irqsave(&sprd_gpio->lock, flags);
tmp = readl_relaxed(base + reg);
if (val)
@@ -63,7 +63,7 @@ static void sprd_gpio_update(struct gpio_chip *chip, unsigned int offset,
tmp &= ~BIT(SPRD_GPIO_BIT(offset));
writel_relaxed(tmp, base + reg);
- spin_unlock_irqrestore(&sprd_gpio->lock, flags);
+ raw_spin_unlock_irqrestore(&sprd_gpio->lock, flags);
}
static int sprd_gpio_read(struct gpio_chip *chip, unsigned int offset, u16 reg)
@@ -236,7 +236,7 @@ static int sprd_gpio_probe(struct platform_device *pdev)
if (IS_ERR(sprd_gpio->base))
return PTR_ERR(sprd_gpio->base);
- spin_lock_init(&sprd_gpio->lock);
+ raw_spin_lock_init(&sprd_gpio->lock);
sprd_gpio->chip.label = dev_name(&pdev->dev);
sprd_gpio->chip.ngpio = SPRD_GPIO_NR;
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 07/43] ALSA: hda/realtek: Add quirk for Inspur S14-G1
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 06/43] gpio: sprd: Change sprd_gpio lock to raw_spin_lock Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 08/43] ASoC: cs35l45: Corrects ASP_TX5 DAPM widget channel Greg Kroah-Hartman
` (45 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhang Heng, Takashi Iwai,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Heng <zhangheng@kylinos.cn>
[ Upstream commit 9e18920e783d0bcd4c127a7adc66565243ab9655 ]
Inspur S14-G1 is equipped with ALC256.
Enable "power saving mode" and Enable "headset jack mode".
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
Link: https://patch.msgid.link/20260126073508.3897461-2-zhangheng@kylinos.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/hda/codecs/realtek/alc269.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 2e9efafa732fe..a77f16abc6df0 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -7243,6 +7243,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1ee7, 0x2078, "HONOR BRB-X M1010", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2),
SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
+ SND_PCI_QUIRK(0x2039, 0x0001, "Inspur S14-G1", ALC295_FIXUP_CHROME_BOOK),
SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13),
SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 08/43] ASoC: cs35l45: Corrects ASP_TX5 DAPM widget channel
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 07/43] ALSA: hda/realtek: Add quirk for Inspur S14-G1 Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 09/43] ALSA: hda/realtek - fixed speaker no sound Greg Kroah-Hartman
` (44 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Charles Keepax, Ricardo Rivera-Matos,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
[ Upstream commit 6dd0fdc908c02318c28ec2c0979661846ee0a9f7 ]
ASP_TX5 was incorrectly mapped to a channel value of 3 corrects,
the channel value of 4.
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Link: https://patch.msgid.link/20260115192523.1335742-2-rriveram@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs35l45.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
index d4dcdf37bb709..9b1eff4e9bb71 100644
--- a/sound/soc/codecs/cs35l45.c
+++ b/sound/soc/codecs/cs35l45.c
@@ -455,7 +455,7 @@ static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = {
SND_SOC_DAPM_AIF_OUT("ASP_TX2", NULL, 1, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX2_EN_SHIFT, 0),
SND_SOC_DAPM_AIF_OUT("ASP_TX3", NULL, 2, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX3_EN_SHIFT, 0),
SND_SOC_DAPM_AIF_OUT("ASP_TX4", NULL, 3, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX4_EN_SHIFT, 0),
- SND_SOC_DAPM_AIF_OUT("ASP_TX5", NULL, 3, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX5_EN_SHIFT, 0),
+ SND_SOC_DAPM_AIF_OUT("ASP_TX5", NULL, 4, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX5_EN_SHIFT, 0),
SND_SOC_DAPM_MUX("ASP_TX1 Source", SND_SOC_NOPM, 0, 0, &cs35l45_asp_muxes[0]),
SND_SOC_DAPM_MUX("ASP_TX2 Source", SND_SOC_NOPM, 0, 0, &cs35l45_asp_muxes[1]),
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 09/43] ALSA: hda/realtek - fixed speaker no sound
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 08/43] ASoC: cs35l45: Corrects ASP_TX5 DAPM widget channel Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 10/43] romfs: check sb_set_blocksize() return value Greg Kroah-Hartman
` (43 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kailang Yang, Takashi Iwai,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kailang Yang <kailang@realtek.com>
[ Upstream commit 630fbc6e870eb06c5126cc97a3abecbe012272c8 ]
If it play a 5s above silence media stream, it will cause silence
detection trigger.
Speaker will make no sound when you use another app to play a stream.
Add this patch will solve this issue.
GPIO2: Mute Hotkey GPIO3: Mic Mute LED
Enable this will turn on hotkey and LED support.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Link: https://lore.kernel.org/f4929e137a7949238cc043d861a4d9f8@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/hda/codecs/realtek/alc269.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index a77f16abc6df0..55ef52fefaef4 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -3371,11 +3371,22 @@ static void alc287_alc1318_playback_pcm_hook(struct hda_pcm_stream *hinfo,
struct snd_pcm_substream *substream,
int action)
{
+ static const struct coef_fw dis_coefs[] = {
+ WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC203),
+ WRITE_COEF(0x28, 0x0004), WRITE_COEF(0x29, 0xb023),
+ }; /* Disable AMP silence detection */
+ static const struct coef_fw en_coefs[] = {
+ WRITE_COEF(0x24, 0x0013), WRITE_COEF(0x25, 0x0000), WRITE_COEF(0x26, 0xC203),
+ WRITE_COEF(0x28, 0x0084), WRITE_COEF(0x29, 0xb023),
+ }; /* Enable AMP silence detection */
+
switch (action) {
case HDA_GEN_PCM_ACT_OPEN:
+ alc_process_coef_fw(codec, dis_coefs);
alc_write_coefex_idx(codec, 0x5a, 0x00, 0x954f); /* write gpio3 to high */
break;
case HDA_GEN_PCM_ACT_CLOSE:
+ alc_process_coef_fw(codec, en_coefs);
alc_write_coefex_idx(codec, 0x5a, 0x00, 0x554f); /* write gpio3 as default value */
break;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 10/43] romfs: check sb_set_blocksize() return value
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 09/43] ALSA: hda/realtek - fixed speaker no sound Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 11/43] =?UTF-8?q?drm/tegra:=20hdmi:=20sor:=20Fix=20error:=20variable=20?= =?UTF-8?q?=E2=80=98j=E2=80=99=20set=20but=20not=20used?= Greg Kroah-Hartman
` (42 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+9c4e33e12283d9437c25,
Deepanshu Kartikey, Christian Brauner, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepanshu Kartikey <kartikey406@gmail.com>
[ Upstream commit ab7ad7abb3660c58ffffdf07ff3bb976e7e0afa0 ]
romfs_fill_super() ignores the return value of sb_set_blocksize(), which
can fail if the requested block size is incompatible with the block
device's configuration.
This can be triggered by setting a loop device's block size larger than
PAGE_SIZE using ioctl(LOOP_SET_BLOCK_SIZE, 32768), then mounting a romfs
filesystem on that device.
When sb_set_blocksize(sb, ROMBSIZE) is called with ROMBSIZE=4096 but the
device has logical_block_size=32768, bdev_validate_blocksize() fails
because the requested size is smaller than the device's logical block
size. sb_set_blocksize() returns 0 (failure), but romfs ignores this and
continues mounting.
The superblock's block size remains at the device's logical block size
(32768). Later, when sb_bread() attempts I/O with this oversized block
size, it triggers a kernel BUG in folio_set_bh():
kernel BUG at fs/buffer.c:1582!
BUG_ON(size > PAGE_SIZE);
Fix by checking the return value of sb_set_blocksize() and failing the
mount with -EINVAL if it returns 0.
Reported-by: syzbot+9c4e33e12283d9437c25@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=9c4e33e12283d9437c25
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Link: https://patch.msgid.link/20260113084037.1167887-1-kartikey406@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/romfs/super.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/romfs/super.c b/fs/romfs/super.c
index 0addcc849ff2c..e83f9b78d7a16 100644
--- a/fs/romfs/super.c
+++ b/fs/romfs/super.c
@@ -458,7 +458,10 @@ static int romfs_fill_super(struct super_block *sb, struct fs_context *fc)
#ifdef CONFIG_BLOCK
if (!sb->s_mtd) {
- sb_set_blocksize(sb, ROMBSIZE);
+ if (!sb_set_blocksize(sb, ROMBSIZE)) {
+ errorf(fc, "romfs: unable to set blocksize\n");
+ return -EINVAL;
+ }
} else {
sb->s_blocksize = ROMBSIZE;
sb->s_blocksize_bits = blksize_bits(ROMBSIZE);
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 11/43] =?UTF-8?q?drm/tegra:=20hdmi:=20sor:=20Fix=20error:=20variable=20?= =?UTF-8?q?=E2=80=98j=E2=80=99=20set=20but=20not=20used?=
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 10/43] romfs: check sb_set_blocksize() return value Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 12/43] platform/x86: classmate-laptop: Add missing NULL pointer checks Greg Kroah-Hartman
` (41 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brahmajit Das, Thierry Reding,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brahmajit Das <listout@listout.xyz>
[ Upstream commit 1beee8d0c263b3e239c8d6616e4f8bb700bed658 ]
The variable j is set, however never used in or outside the loop, thus
resulting in dead code.
Building with GCC 16 results in a build error due to
-Werror=unused-but-set-variable= enabled by default.
This patch clean up the dead code and fixes the build error.
Example build log:
drivers/gpu/drm/tegra/sor.c:1867:19: error: variable ‘j’ set but not used [-Werror=unused-but-set-variable=]
1867 | size_t i, j;
| ^
Signed-off-by: Brahmajit Das <listout@listout.xyz>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20250901212020.3757519-1-listout@listout.xyz
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/tegra/hdmi.c | 4 ++--
drivers/gpu/drm/tegra/sor.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 8cd2969e7d4bf..c4820f5e76581 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -658,7 +658,7 @@ static void tegra_hdmi_write_infopack(struct tegra_hdmi *hdmi, const void *data,
{
const u8 *ptr = data;
unsigned long offset;
- size_t i, j;
+ size_t i;
u32 value;
switch (ptr[0]) {
@@ -691,7 +691,7 @@ static void tegra_hdmi_write_infopack(struct tegra_hdmi *hdmi, const void *data,
* - subpack_low: bytes 0 - 3
* - subpack_high: bytes 4 - 6 (with byte 7 padded to 0x00)
*/
- for (i = 3, j = 0; i < size; i += 7, j += 8) {
+ for (i = 3; i < size; i += 7) {
size_t rem = size - i, num = min_t(size_t, rem, 4);
value = tegra_hdmi_subpack(&ptr[i], num);
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 21f3dfdcc5c95..bc7dd562cf6b6 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1864,7 +1864,7 @@ static void tegra_sor_hdmi_write_infopack(struct tegra_sor *sor,
{
const u8 *ptr = data;
unsigned long offset;
- size_t i, j;
+ size_t i;
u32 value;
switch (ptr[0]) {
@@ -1897,7 +1897,7 @@ static void tegra_sor_hdmi_write_infopack(struct tegra_sor *sor,
* - subpack_low: bytes 0 - 3
* - subpack_high: bytes 4 - 6 (with byte 7 padded to 0x00)
*/
- for (i = 3, j = 0; i < size; i += 7, j += 8) {
+ for (i = 3; i < size; i += 7) {
size_t rem = size - i, num = min_t(size_t, rem, 4);
value = tegra_sor_hdmi_subpack(&ptr[i], num);
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 12/43] platform/x86: classmate-laptop: Add missing NULL pointer checks
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 11/43] =?UTF-8?q?drm/tegra:=20hdmi:=20sor:=20Fix=20error:=20variable=20?= =?UTF-8?q?=E2=80=98j=E2=80=99=20set=20but=20not=20used?= Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 13/43] ASoC: Intel: sof_es8336: Add DMI quirk for Huawei BOD-WXX9 Greg Kroah-Hartman
` (40 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki,
Ilpo Järvinen, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit fe747d7112283f47169e9c16e751179a9b38611e ]
In a few places in the Classmate laptop driver, code using the accel
object may run before that object's address is stored in the driver
data of the input device using it.
For example, cmpc_accel_sensitivity_store_v4() is the "show" method
of cmpc_accel_sensitivity_attr_v4 which is added in cmpc_accel_add_v4(),
before calling dev_set_drvdata() for inputdev->dev. If the sysfs
attribute is accessed prematurely, the dev_get_drvdata(&inputdev->dev)
call in in cmpc_accel_sensitivity_store_v4() returns NULL which
leads to a NULL pointer dereference going forward.
Moreover, sysfs attributes using the input device are added before
initializing that device by cmpc_add_acpi_notify_device() and if one
of them is accessed before running that function, a NULL pointer
dereference will occur.
For example, cmpc_accel_sensitivity_attr_v4 is added before calling
cmpc_add_acpi_notify_device() and if it is read prematurely, the
dev_get_drvdata(&acpi->dev) call in cmpc_accel_sensitivity_show_v4()
returns NULL which leads to a NULL pointer dereference going forward.
Fix this by adding NULL pointer checks in all of the relevant places.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/12825381.O9o76ZdvQC@rafael.j.wysocki
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/classmate-laptop.c | 32 +++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 6b1b8e444e241..74d3eb83f56a6 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -207,7 +207,12 @@ static ssize_t cmpc_accel_sensitivity_show_v4(struct device *dev,
acpi = to_acpi_device(dev);
inputdev = dev_get_drvdata(&acpi->dev);
+ if (!inputdev)
+ return -ENXIO;
+
accel = dev_get_drvdata(&inputdev->dev);
+ if (!accel)
+ return -ENXIO;
return sysfs_emit(buf, "%d\n", accel->sensitivity);
}
@@ -224,7 +229,12 @@ static ssize_t cmpc_accel_sensitivity_store_v4(struct device *dev,
acpi = to_acpi_device(dev);
inputdev = dev_get_drvdata(&acpi->dev);
+ if (!inputdev)
+ return -ENXIO;
+
accel = dev_get_drvdata(&inputdev->dev);
+ if (!accel)
+ return -ENXIO;
r = kstrtoul(buf, 0, &sensitivity);
if (r)
@@ -256,7 +266,12 @@ static ssize_t cmpc_accel_g_select_show_v4(struct device *dev,
acpi = to_acpi_device(dev);
inputdev = dev_get_drvdata(&acpi->dev);
+ if (!inputdev)
+ return -ENXIO;
+
accel = dev_get_drvdata(&inputdev->dev);
+ if (!accel)
+ return -ENXIO;
return sysfs_emit(buf, "%d\n", accel->g_select);
}
@@ -273,7 +288,12 @@ static ssize_t cmpc_accel_g_select_store_v4(struct device *dev,
acpi = to_acpi_device(dev);
inputdev = dev_get_drvdata(&acpi->dev);
+ if (!inputdev)
+ return -ENXIO;
+
accel = dev_get_drvdata(&inputdev->dev);
+ if (!accel)
+ return -ENXIO;
r = kstrtoul(buf, 0, &g_select);
if (r)
@@ -302,6 +322,8 @@ static int cmpc_accel_open_v4(struct input_dev *input)
acpi = to_acpi_device(input->dev.parent);
accel = dev_get_drvdata(&input->dev);
+ if (!accel)
+ return -ENXIO;
cmpc_accel_set_sensitivity_v4(acpi->handle, accel->sensitivity);
cmpc_accel_set_g_select_v4(acpi->handle, accel->g_select);
@@ -549,7 +571,12 @@ static ssize_t cmpc_accel_sensitivity_show(struct device *dev,
acpi = to_acpi_device(dev);
inputdev = dev_get_drvdata(&acpi->dev);
+ if (!inputdev)
+ return -ENXIO;
+
accel = dev_get_drvdata(&inputdev->dev);
+ if (!accel)
+ return -ENXIO;
return sysfs_emit(buf, "%d\n", accel->sensitivity);
}
@@ -566,7 +593,12 @@ static ssize_t cmpc_accel_sensitivity_store(struct device *dev,
acpi = to_acpi_device(dev);
inputdev = dev_get_drvdata(&acpi->dev);
+ if (!inputdev)
+ return -ENXIO;
+
accel = dev_get_drvdata(&inputdev->dev);
+ if (!accel)
+ return -ENXIO;
r = kstrtoul(buf, 0, &sensitivity);
if (r)
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 13/43] ASoC: Intel: sof_es8336: Add DMI quirk for Huawei BOD-WXX9
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 12/43] platform/x86: classmate-laptop: Add missing NULL pointer checks Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 14/43] ASoC: amd: yc: Add quirk for HP 200 G2a 16 Greg Kroah-Hartman
` (39 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tagir Garaev, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tagir Garaev <tgaraev653@gmail.com>
[ Upstream commit 6b641122d31f9d33e7d60047ee0586d1659f3f54 ]
Add DMI entry for Huawei Matebook D (BOD-WXX9) with HEADPHONE_GPIO
and DMIC quirks.
This device has ES8336 codec with:
- GPIO 16 (headphone-enable) for headphone amplifier control
- GPIO 17 (speakers-enable) for speaker amplifier control
- GPIO 269 for jack detection IRQ
- 2-channel DMIC
Hardware investigation shows that both GPIO 16 and 17 are required
for proper audio routing, as headphones and speakers share the same
physical output (HPOL/HPOR) and are separated only via amplifier
enable signals.
RFC: Seeking advice on GPIO control issue:
GPIO values change in driver (gpiod_get_value() shows logical value
changes) but not physically (debugfs gpio shows no change). The same
gpiod_set_value_cansleep() calls work correctly in probe context with
msleep(), but fail when called from DAPM event callbacks.
Context information from diagnostics:
- in_atomic=0, in_interrupt=0, irqs_disabled=0
- Process context: pipewire
- GPIO 17 (speakers): changes in driver, no physical change
- GPIO 16 (headphone): changes in driver, no physical change
In Windows, audio switching works without visible GPIO changes,
suggesting possible ACPI/firmware involvement.
Any suggestions on how to properly control these GPIOs from DAPM
events would be appreciated.
Signed-off-by: Tagir Garaev <tgaraev653@gmail.com>
Link: https://patch.msgid.link/20260201121728.16597-1-tgaraev653@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/intel/boards/sof_es8336.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c
index 09acd80d23e0f..cf50de5c2edd8 100644
--- a/sound/soc/intel/boards/sof_es8336.c
+++ b/sound/soc/intel/boards/sof_es8336.c
@@ -332,6 +332,15 @@ static int sof_es8336_quirk_cb(const struct dmi_system_id *id)
* if the topology file is modified as well.
*/
static const struct dmi_system_id sof_es8336_quirk_table[] = {
+ {
+ .callback = sof_es8336_quirk_cb,
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "HUAWEI"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "BOD-WXX9"),
+ },
+ .driver_data = (void *)(SOF_ES8336_HEADPHONE_GPIO |
+ SOF_ES8336_ENABLE_DMIC)
+ },
{
.callback = sof_es8336_quirk_cb,
.matches = {
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 14/43] ASoC: amd: yc: Add quirk for HP 200 G2a 16
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 13/43] ASoC: Intel: sof_es8336: Add DMI quirk for Huawei BOD-WXX9 Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 15/43] ALSA: hda/realtek: Enable headset mic for Acer Nitro 5 Greg Kroah-Hartman
` (38 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dirk Su, Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dirk Su <dirk.su@canonical.com>
[ Upstream commit 611c7d2262d5645118e0b3a9a88475d35a8366f2 ]
Fix the missing mic on HP 200 G2a 16 by adding quirk with the
board ID 8EE4
Signed-off-by: Dirk Su <dirk.su@canonical.com>
Link: https://patch.msgid.link/20260129065038.39349-1-dirk.su@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/yc/acp6x-mach.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index c18da0915baad..67f2fee193980 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -640,6 +640,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_BOARD_NAME, "8BD6"),
}
},
+ {
+ .driver_data = &acp6x_card,
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
+ DMI_MATCH(DMI_BOARD_NAME, "8EE4"),
+ }
+ },
{
.driver_data = &acp6x_card,
.matches = {
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 15/43] ALSA: hda/realtek: Enable headset mic for Acer Nitro 5
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 14/43] ASoC: amd: yc: Add quirk for HP 200 G2a 16 Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 16/43] platform/x86/amd/pmc: Add quirk for MECHREVO Wujie 15X Pro Greg Kroah-Hartman
` (37 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Baptista, Takashi Iwai,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Baptista <brenomb07@gmail.com>
[ Upstream commit 51db05283f7c9c95a3e6853a3044cd04226551bf ]
Add quirk to support microphone input through headphone jack on Acer Nitro 5 AN515-57 (ALC295).
Signed-off-by: Breno Baptista <brenomb07@gmail.com>
Link: https://patch.msgid.link/20260205024341.26694-1-brenomb07@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/hda/codecs/realtek/alc269.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 55ef52fefaef4..a16cb45ac59e3 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -6271,6 +6271,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
+ SND_PCI_QUIRK(0x1025, 0x1539, "Acer Nitro 5 AN515-57", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x1597, "Acer Nitro 5 AN517-55", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 16/43] platform/x86/amd/pmc: Add quirk for MECHREVO Wujie 15X Pro
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 15/43] ALSA: hda/realtek: Enable headset mic for Acer Nitro 5 Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 17/43] ASoC: sof_sdw: Add a quirk for Lenovo laptop using sidecar amps with cs42l43 Greg Kroah-Hartman
` (36 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, gongqi, Ilpo Järvinen,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: gongqi <550230171hxy@gmail.com>
[ Upstream commit 2b4e00d8e70ca8736fda82447be6a4e323c6d1f5 ]
The MECHREVO Wujie 15X Pro suffers from spurious IRQ issues related to
the AMD PMC. Add it to the quirk list to use the spurious_8042 fix.
Signed-off-by: gongqi <550230171hxy@gmail.com>
Link: https://patch.msgid.link/20260122155501.376199-4-550230171hxy@gmail.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/amd/pmc/pmc-quirks.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/platform/x86/amd/pmc/pmc-quirks.c b/drivers/platform/x86/amd/pmc/pmc-quirks.c
index 404e62ad293a9..ed285afaf9b0d 100644
--- a/drivers/platform/x86/amd/pmc/pmc-quirks.c
+++ b/drivers/platform/x86/amd/pmc/pmc-quirks.c
@@ -302,6 +302,13 @@ static const struct dmi_system_id fwbug_list[] = {
DMI_MATCH(DMI_BOARD_NAME, "XxKK4NAx_XxSP4NAx"),
}
},
+ {
+ .ident = "MECHREVO Wujie 15X Pro",
+ .driver_data = &quirk_spurious_8042,
+ .matches = {
+ DMI_MATCH(DMI_BOARD_NAME, "WUJIE Series-X5SP4NAG"),
+ }
+ },
{}
};
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 17/43] ASoC: sof_sdw: Add a quirk for Lenovo laptop using sidecar amps with cs42l43
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 16/43] platform/x86/amd/pmc: Add quirk for MECHREVO Wujie 15X Pro Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 18/43] platform/x86: panasonic-laptop: Fix sysfs group leak in error path Greg Kroah-Hartman
` (35 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Strozek, Cezary Rojewski,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej Strozek <mstrozek@opensource.cirrus.com>
[ Upstream commit 1425900231372acf870dd89e8d3bb4935f7f0c81 ]
Add a quirk for a Lenovo laptop (SSID: 0x17aa3821) to allow using sidecar
CS35L57 amps with CS42L43 codec.
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20260128092410.1540583-1-mstrozek@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/intel/boards/sof_sdw.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 92fac7ed782f7..6c95b1f8fc1a5 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -802,6 +802,7 @@ static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = {
SND_PCI_QUIRK(0x17aa, 0x2347, "Lenovo P16", SOC_SDW_CODEC_MIC),
SND_PCI_QUIRK(0x17aa, 0x2348, "Lenovo P16", SOC_SDW_CODEC_MIC),
SND_PCI_QUIRK(0x17aa, 0x2349, "Lenovo P1", SOC_SDW_CODEC_MIC),
+ SND_PCI_QUIRK(0x17aa, 0x3821, "Lenovo 0x3821", SOC_SDW_SIDECAR_AMPS),
{}
};
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 18/43] platform/x86: panasonic-laptop: Fix sysfs group leak in error path
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 17/43] ASoC: sof_sdw: Add a quirk for Lenovo laptop using sidecar amps with cs42l43 Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 19/43] ASoC: cs42l43: Correct handling of 3-pole jack load detection Greg Kroah-Hartman
` (34 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki,
Ilpo Järvinen, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 43b0b7eff4b3fb684f257d5a24376782e9663465 ]
The acpi_pcc_hotkey_add() error path leaks sysfs group pcc_attr_group
if platform_device_register_simple() fails for the "panasonic" platform
device.
Address this by making it call sysfs_remove_group() in that case for
the group in question.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3398370.44csPzL39Z@rafael.j.wysocki
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/panasonic-laptop.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index 255317e6fec88..937f1a5b78edf 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -1089,7 +1089,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
PLATFORM_DEVID_NONE, NULL, 0);
if (IS_ERR(pcc->platform)) {
result = PTR_ERR(pcc->platform);
- goto out_backlight;
+ goto out_sysfs;
}
result = device_create_file(&pcc->platform->dev,
&dev_attr_cdpower);
@@ -1105,6 +1105,8 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
out_platform:
platform_device_unregister(pcc->platform);
+out_sysfs:
+ sysfs_remove_group(&device->dev.kobj, &pcc_attr_group);
out_backlight:
backlight_device_unregister(pcc->backlight);
out_input:
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 19/43] ASoC: cs42l43: Correct handling of 3-pole jack load detection
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 18/43] platform/x86: panasonic-laptop: Fix sysfs group leak in error path Greg Kroah-Hartman
@ 2026-02-17 20:31 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 20/43] tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow Greg Kroah-Hartman
` (33 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:31 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Charles Keepax, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <ckeepax@opensource.cirrus.com>
[ Upstream commit e77a4081d7e324dfa876a9560b2a78969446ba82 ]
The load detection process for 3-pole jacks requires slightly
updated reference values to ensure an accurate result. Update
the code to apply different tunings for the 3-pole and 4-pole
cases. This also updates the thresholds overall so update the
relevant comments to match.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260130150927.2964664-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs42l43-jack.c | 37 +++++++++++++++++++++++++++------
1 file changed, 31 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/cs42l43-jack.c b/sound/soc/codecs/cs42l43-jack.c
index 867e23d4fb8d8..744488f371ea4 100644
--- a/sound/soc/codecs/cs42l43-jack.c
+++ b/sound/soc/codecs/cs42l43-jack.c
@@ -496,7 +496,23 @@ void cs42l43_bias_sense_timeout(struct work_struct *work)
pm_runtime_put_autosuspend(priv->dev);
}
-static void cs42l43_start_load_detect(struct cs42l43_codec *priv)
+static const struct reg_sequence cs42l43_3pole_patch[] = {
+ { 0x4000, 0x00000055 },
+ { 0x4000, 0x000000AA },
+ { 0x17420, 0x8500F300 },
+ { 0x17424, 0x36003E00 },
+ { 0x4000, 0x00000000 },
+};
+
+static const struct reg_sequence cs42l43_4pole_patch[] = {
+ { 0x4000, 0x00000055 },
+ { 0x4000, 0x000000AA },
+ { 0x17420, 0x7800E600 },
+ { 0x17424, 0x36003800 },
+ { 0x4000, 0x00000000 },
+};
+
+static void cs42l43_start_load_detect(struct cs42l43_codec *priv, bool mic)
{
struct cs42l43 *cs42l43 = priv->core;
@@ -520,6 +536,15 @@ static void cs42l43_start_load_detect(struct cs42l43_codec *priv)
dev_err(priv->dev, "Load detect HP power down timed out\n");
}
+ if (mic)
+ regmap_multi_reg_write_bypassed(cs42l43->regmap,
+ cs42l43_4pole_patch,
+ ARRAY_SIZE(cs42l43_4pole_patch));
+ else
+ regmap_multi_reg_write_bypassed(cs42l43->regmap,
+ cs42l43_3pole_patch,
+ ARRAY_SIZE(cs42l43_3pole_patch));
+
regmap_update_bits(cs42l43->regmap, CS42L43_BLOCK_EN3,
CS42L43_ADC1_EN_MASK | CS42L43_ADC2_EN_MASK, 0);
regmap_update_bits(cs42l43->regmap, CS42L43_DACCNFG2, CS42L43_HP_HPF_EN_MASK, 0);
@@ -598,7 +623,7 @@ static int cs42l43_run_load_detect(struct cs42l43_codec *priv, bool mic)
reinit_completion(&priv->load_detect);
- cs42l43_start_load_detect(priv);
+ cs42l43_start_load_detect(priv, mic);
time_left = wait_for_completion_timeout(&priv->load_detect,
msecs_to_jiffies(CS42L43_LOAD_TIMEOUT_MS));
cs42l43_stop_load_detect(priv);
@@ -622,11 +647,11 @@ static int cs42l43_run_load_detect(struct cs42l43_codec *priv, bool mic)
}
switch (val & CS42L43_AMP3_RES_DET_MASK) {
- case 0x0: // low impedance
- case 0x1: // high impedance
+ case 0x0: // < 22 Ohm impedance
+ case 0x1: // < 150 Ohm impedance
+ case 0x2: // < 1000 Ohm impedance
return CS42L43_JACK_HEADPHONE;
- case 0x2: // lineout
- case 0x3: // Open circuit
+ case 0x3: // > 1000 Ohm impedance
return CS42L43_JACK_LINEOUT;
default:
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 20/43] tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2026-02-17 20:31 ` [PATCH 6.18 19/43] ASoC: cs42l43: Correct handling of 3-pole jack load detection Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 21/43] drm/amd/display: extend delta clamping logic to CM3 LUT helper Greg Kroah-Hartman
` (32 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+28cea38c382fd15e751a,
Deepanshu Kartikey, Marek Szyprowski, Sasha Levin, Sean Anderson
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Deepanshu Kartikey <kartikey406@gmail.com>
[ Upstream commit daafcc0ef0b358d9d622b6e3b7c43767aa3814ee ]
The dma_map_sg tracepoint can trigger a perf buffer overflow when
tracing large scatter-gather lists. With devices like virtio-gpu
creating large DRM buffers, nents can exceed 1000 entries, resulting
in:
phys_addrs: 1000 * 8 bytes = 8,000 bytes
dma_addrs: 1000 * 8 bytes = 8,000 bytes
lengths: 1000 * 4 bytes = 4,000 bytes
Total: ~20,000 bytes
This exceeds PERF_MAX_TRACE_SIZE (8192 bytes), causing:
WARNING: CPU: 0 PID: 5497 at kernel/trace/trace_event_perf.c:405
perf buffer not large enough, wanted 24620, have 8192
Cap all three dynamic arrays at 128 entries using min() in the array
size calculation. This ensures arrays are only as large as needed
(up to the cap), avoiding unnecessary memory allocation for small
operations while preventing overflow for large ones.
The tracepoint now records the full nents/ents counts and a truncated
flag so users can see when data has been capped.
Changes in v2:
- Use min(nents, DMA_TRACE_MAX_ENTRIES) for dynamic array sizing
instead of fixed DMA_TRACE_MAX_ENTRIES allocation (feedback from
Steven Rostedt)
- This allocates only what's needed up to the cap, avoiding waste
for small operations
Reported-by: syzbot+28cea38c382fd15e751a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=28cea38c382fd15e751a
Tested-by: syzbot+28cea38c382fd15e751a@syzkaller.appspotmail.com
Signed-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>
Reviwed-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20260130155215.69737-1-kartikey406@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/trace/events/dma.h | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/include/trace/events/dma.h b/include/trace/events/dma.h
index b3fef140ae155..33e99e792f1aa 100644
--- a/include/trace/events/dma.h
+++ b/include/trace/events/dma.h
@@ -275,6 +275,8 @@ TRACE_EVENT(dma_free_sgt,
sizeof(u64), sizeof(u64)))
);
+#define DMA_TRACE_MAX_ENTRIES 128
+
TRACE_EVENT(dma_map_sg,
TP_PROTO(struct device *dev, struct scatterlist *sgl, int nents,
int ents, enum dma_data_direction dir, unsigned long attrs),
@@ -282,9 +284,12 @@ TRACE_EVENT(dma_map_sg,
TP_STRUCT__entry(
__string(device, dev_name(dev))
- __dynamic_array(u64, phys_addrs, nents)
- __dynamic_array(u64, dma_addrs, ents)
- __dynamic_array(unsigned int, lengths, ents)
+ __field(int, full_nents)
+ __field(int, full_ents)
+ __field(bool, truncated)
+ __dynamic_array(u64, phys_addrs, min(nents, DMA_TRACE_MAX_ENTRIES))
+ __dynamic_array(u64, dma_addrs, min(ents, DMA_TRACE_MAX_ENTRIES))
+ __dynamic_array(unsigned int, lengths, min(ents, DMA_TRACE_MAX_ENTRIES))
__field(enum dma_data_direction, dir)
__field(unsigned long, attrs)
),
@@ -292,11 +297,16 @@ TRACE_EVENT(dma_map_sg,
TP_fast_assign(
struct scatterlist *sg;
int i;
+ int traced_nents = min_t(int, nents, DMA_TRACE_MAX_ENTRIES);
+ int traced_ents = min_t(int, ents, DMA_TRACE_MAX_ENTRIES);
__assign_str(device);
- for_each_sg(sgl, sg, nents, i)
+ __entry->full_nents = nents;
+ __entry->full_ents = ents;
+ __entry->truncated = (nents > DMA_TRACE_MAX_ENTRIES) || (ents > DMA_TRACE_MAX_ENTRIES);
+ for_each_sg(sgl, sg, traced_nents, i)
((u64 *)__get_dynamic_array(phys_addrs))[i] = sg_phys(sg);
- for_each_sg(sgl, sg, ents, i) {
+ for_each_sg(sgl, sg, traced_ents, i) {
((u64 *)__get_dynamic_array(dma_addrs))[i] =
sg_dma_address(sg);
((unsigned int *)__get_dynamic_array(lengths))[i] =
@@ -306,9 +316,12 @@ TRACE_EVENT(dma_map_sg,
__entry->attrs = attrs;
),
- TP_printk("%s dir=%s dma_addrs=%s sizes=%s phys_addrs=%s attrs=%s",
+ TP_printk("%s dir=%s nents=%d/%d ents=%d/%d%s dma_addrs=%s sizes=%s phys_addrs=%s attrs=%s",
__get_str(device),
decode_dma_data_direction(__entry->dir),
+ min_t(int, __entry->full_nents, DMA_TRACE_MAX_ENTRIES), __entry->full_nents,
+ min_t(int, __entry->full_ents, DMA_TRACE_MAX_ENTRIES), __entry->full_ents,
+ __entry->truncated ? " [TRUNCATED]" : "",
__print_array(__get_dynamic_array(dma_addrs),
__get_dynamic_array_len(dma_addrs) /
sizeof(u64), sizeof(u64)),
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 21/43] drm/amd/display: extend delta clamping logic to CM3 LUT helper
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 20/43] tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 22/43] drm/amd/display: remove assert around dpp_base replacement Greg Kroah-Hartman
` (31 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Harry Wentland,
Alex Deucher, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit d25b32aa829a3ed5570138e541a71fb7805faec3 ]
Commit 27fc10d1095f ("drm/amd/display: Fix the delta clamping for shaper
LUT") fixed banding when using plane shaper LUT in DCN10 CM helper. The
problem is also present in DCN30 CM helper, fix banding by extending the
same bug delta clamping fix to CM3.
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0274a54897f356f9c78767c4a2a5863f7dde90c6)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../amd/display/dc/dcn30/dcn30_cm_common.c | 30 +++++++++++++++----
.../display/dc/dwb/dcn30/dcn30_cm_common.h | 2 +-
.../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 9 +++---
.../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 17 ++++++-----
.../amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 16 +++++-----
5 files changed, 49 insertions(+), 25 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c
index a4f14b16564c2..227aa8672d17b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c
@@ -105,9 +105,12 @@ void cm_helper_program_gamcor_xfer_func(
#define NUMBER_REGIONS 32
#define NUMBER_SW_SEGMENTS 16
-bool cm3_helper_translate_curve_to_hw_format(
- const struct dc_transfer_func *output_tf,
- struct pwl_params *lut_params, bool fixpoint)
+#define DC_LOGGER \
+ ctx->logger
+
+bool cm3_helper_translate_curve_to_hw_format(struct dc_context *ctx,
+ const struct dc_transfer_func *output_tf,
+ struct pwl_params *lut_params, bool fixpoint)
{
struct curve_points3 *corner_points;
struct pwl_result_data *rgb_resulted;
@@ -251,6 +254,10 @@ bool cm3_helper_translate_curve_to_hw_format(
if (fixpoint == true) {
i = 1;
while (i != hw_points + 2) {
+ uint32_t red_clamp;
+ uint32_t green_clamp;
+ uint32_t blue_clamp;
+
if (i >= hw_points) {
if (dc_fixpt_lt(rgb_plus_1->red, rgb->red))
rgb_plus_1->red = dc_fixpt_add(rgb->red,
@@ -263,9 +270,20 @@ bool cm3_helper_translate_curve_to_hw_format(
rgb_minus_1->delta_blue);
}
- rgb->delta_red_reg = dc_fixpt_clamp_u0d10(rgb->delta_red);
- rgb->delta_green_reg = dc_fixpt_clamp_u0d10(rgb->delta_green);
- rgb->delta_blue_reg = dc_fixpt_clamp_u0d10(rgb->delta_blue);
+ rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red);
+ rgb->delta_green = dc_fixpt_sub(rgb_plus_1->green, rgb->green);
+ rgb->delta_blue = dc_fixpt_sub(rgb_plus_1->blue, rgb->blue);
+
+ red_clamp = dc_fixpt_clamp_u0d14(rgb->delta_red);
+ green_clamp = dc_fixpt_clamp_u0d14(rgb->delta_green);
+ blue_clamp = dc_fixpt_clamp_u0d14(rgb->delta_blue);
+
+ if (red_clamp >> 10 || green_clamp >> 10 || blue_clamp >> 10)
+ DC_LOG_ERROR("Losing delta precision while programming shaper LUT.");
+
+ rgb->delta_red_reg = red_clamp & 0x3ff;
+ rgb->delta_green_reg = green_clamp & 0x3ff;
+ rgb->delta_blue_reg = blue_clamp & 0x3ff;
rgb->red_reg = dc_fixpt_clamp_u0d14(rgb->red);
rgb->green_reg = dc_fixpt_clamp_u0d14(rgb->green);
rgb->blue_reg = dc_fixpt_clamp_u0d14(rgb->blue);
diff --git a/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_cm_common.h b/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_cm_common.h
index b86347c9b0389..95f9318a54efc 100644
--- a/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_cm_common.h
+++ b/drivers/gpu/drm/amd/display/dc/dwb/dcn30/dcn30_cm_common.h
@@ -59,7 +59,7 @@ void cm_helper_program_gamcor_xfer_func(
const struct pwl_params *params,
const struct dcn3_xfer_func_reg *reg);
-bool cm3_helper_translate_curve_to_hw_format(
+bool cm3_helper_translate_curve_to_hw_format(struct dc_context *ctx,
const struct dc_transfer_func *output_tf,
struct pwl_params *lut_params, bool fixpoint);
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
index e47ed5571dfdd..731645a2ab9aa 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
@@ -238,7 +238,7 @@ bool dcn30_set_blend_lut(
if (plane_state->blend_tf.type == TF_TYPE_HWPWL)
blend_lut = &plane_state->blend_tf.pwl;
else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) {
- result = cm3_helper_translate_curve_to_hw_format(
+ result = cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
&plane_state->blend_tf, &dpp_base->regamma_params, false);
if (!result)
return result;
@@ -333,8 +333,9 @@ bool dcn30_set_input_transfer_func(struct dc *dc,
if (plane_state->in_transfer_func.type == TF_TYPE_HWPWL)
params = &plane_state->in_transfer_func.pwl;
else if (plane_state->in_transfer_func.type == TF_TYPE_DISTRIBUTED_POINTS &&
- cm3_helper_translate_curve_to_hw_format(&plane_state->in_transfer_func,
- &dpp_base->degamma_params, false))
+ cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
+ &plane_state->in_transfer_func,
+ &dpp_base->degamma_params, false))
params = &dpp_base->degamma_params;
result = dpp_base->funcs->dpp_program_gamcor_lut(dpp_base, params);
@@ -405,7 +406,7 @@ bool dcn30_set_output_transfer_func(struct dc *dc,
params = &stream->out_transfer_func.pwl;
else if (pipe_ctx->stream->out_transfer_func.type ==
TF_TYPE_DISTRIBUTED_POINTS &&
- cm3_helper_translate_curve_to_hw_format(
+ cm3_helper_translate_curve_to_hw_format(stream->ctx,
&stream->out_transfer_func,
&mpc->blender_params, false))
params = &mpc->blender_params;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
index f39292952702f..30bb5d8d85dc2 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
@@ -486,8 +486,9 @@ bool dcn32_set_mcm_luts(
if (plane_state->blend_tf.type == TF_TYPE_HWPWL)
lut_params = &plane_state->blend_tf.pwl;
else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) {
- result = cm3_helper_translate_curve_to_hw_format(&plane_state->blend_tf,
- &dpp_base->regamma_params, false);
+ result = cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
+ &plane_state->blend_tf,
+ &dpp_base->regamma_params, false);
if (!result)
return result;
@@ -502,8 +503,9 @@ bool dcn32_set_mcm_luts(
else if (plane_state->in_shaper_func.type == TF_TYPE_DISTRIBUTED_POINTS) {
// TODO: dpp_base replace
ASSERT(false);
- cm3_helper_translate_curve_to_hw_format(&plane_state->in_shaper_func,
- &dpp_base->shaper_params, true);
+ cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
+ &plane_state->in_shaper_func,
+ &dpp_base->shaper_params, true);
lut_params = &dpp_base->shaper_params;
}
@@ -543,8 +545,9 @@ bool dcn32_set_input_transfer_func(struct dc *dc,
if (plane_state->in_transfer_func.type == TF_TYPE_HWPWL)
params = &plane_state->in_transfer_func.pwl;
else if (plane_state->in_transfer_func.type == TF_TYPE_DISTRIBUTED_POINTS &&
- cm3_helper_translate_curve_to_hw_format(&plane_state->in_transfer_func,
- &dpp_base->degamma_params, false))
+ cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
+ &plane_state->in_transfer_func,
+ &dpp_base->degamma_params, false))
params = &dpp_base->degamma_params;
dpp_base->funcs->dpp_program_gamcor_lut(dpp_base, params);
@@ -575,7 +578,7 @@ bool dcn32_set_output_transfer_func(struct dc *dc,
params = &stream->out_transfer_func.pwl;
else if (pipe_ctx->stream->out_transfer_func.type ==
TF_TYPE_DISTRIBUTED_POINTS &&
- cm3_helper_translate_curve_to_hw_format(
+ cm3_helper_translate_curve_to_hw_format(stream->ctx,
&stream->out_transfer_func,
&mpc->blender_params, false))
params = &mpc->blender_params;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
index 68e48a2492c9e..77cdd02a41bdd 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
@@ -427,7 +427,7 @@ void dcn401_populate_mcm_luts(struct dc *dc,
if (mcm_luts.lut1d_func->type == TF_TYPE_HWPWL)
m_lut_params.pwl = &mcm_luts.lut1d_func->pwl;
else if (mcm_luts.lut1d_func->type == TF_TYPE_DISTRIBUTED_POINTS) {
- rval = cm3_helper_translate_curve_to_hw_format(
+ rval = cm3_helper_translate_curve_to_hw_format(mpc->ctx,
mcm_luts.lut1d_func,
&dpp_base->regamma_params, false);
m_lut_params.pwl = rval ? &dpp_base->regamma_params : NULL;
@@ -447,7 +447,7 @@ void dcn401_populate_mcm_luts(struct dc *dc,
m_lut_params.pwl = &mcm_luts.shaper->pwl;
else if (mcm_luts.shaper->type == TF_TYPE_DISTRIBUTED_POINTS) {
ASSERT(false);
- rval = cm3_helper_translate_curve_to_hw_format(
+ rval = cm3_helper_translate_curve_to_hw_format(mpc->ctx,
mcm_luts.shaper,
&dpp_base->regamma_params, true);
m_lut_params.pwl = rval ? &dpp_base->regamma_params : NULL;
@@ -624,8 +624,9 @@ bool dcn401_set_mcm_luts(struct pipe_ctx *pipe_ctx,
if (plane_state->blend_tf.type == TF_TYPE_HWPWL)
lut_params = &plane_state->blend_tf.pwl;
else if (plane_state->blend_tf.type == TF_TYPE_DISTRIBUTED_POINTS) {
- rval = cm3_helper_translate_curve_to_hw_format(&plane_state->blend_tf,
- &dpp_base->regamma_params, false);
+ rval = cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
+ &plane_state->blend_tf,
+ &dpp_base->regamma_params, false);
lut_params = rval ? &dpp_base->regamma_params : NULL;
}
result = mpc->funcs->program_1dlut(mpc, lut_params, mpcc_id);
@@ -636,8 +637,9 @@ bool dcn401_set_mcm_luts(struct pipe_ctx *pipe_ctx,
lut_params = &plane_state->in_shaper_func.pwl;
else if (plane_state->in_shaper_func.type == TF_TYPE_DISTRIBUTED_POINTS) {
// TODO: dpp_base replace
- rval = cm3_helper_translate_curve_to_hw_format(&plane_state->in_shaper_func,
- &dpp_base->shaper_params, true);
+ rval = cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
+ &plane_state->in_shaper_func,
+ &dpp_base->shaper_params, true);
lut_params = rval ? &dpp_base->shaper_params : NULL;
}
result &= mpc->funcs->program_shaper(mpc, lut_params, mpcc_id);
@@ -671,7 +673,7 @@ bool dcn401_set_output_transfer_func(struct dc *dc,
params = &stream->out_transfer_func.pwl;
else if (pipe_ctx->stream->out_transfer_func.type ==
TF_TYPE_DISTRIBUTED_POINTS &&
- cm3_helper_translate_curve_to_hw_format(
+ cm3_helper_translate_curve_to_hw_format(stream->ctx,
&stream->out_transfer_func,
&mpc->blender_params, false))
params = &mpc->blender_params;
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 22/43] drm/amd/display: remove assert around dpp_base replacement
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 21/43] drm/amd/display: extend delta clamping logic to CM3 LUT helper Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 23/43] ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put() Greg Kroah-Hartman
` (30 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Alex Hung, Alex Deucher,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 84962445cd8a83dc5bed4c8ad5bbb2c1cdb249a0 ]
There is nothing wrong if in_shaper_func type is DISTRIBUTED POINTS.
Remove the assert placed for a TODO to avoid misinterpretations.
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1714dcc4c2c53e41190896eba263ed6328bcf415)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
index 30bb5d8d85dc2..c6fde355ac823 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
@@ -502,7 +502,6 @@ bool dcn32_set_mcm_luts(
lut_params = &plane_state->in_shaper_func.pwl;
else if (plane_state->in_shaper_func.type == TF_TYPE_DISTRIBUTED_POINTS) {
// TODO: dpp_base replace
- ASSERT(false);
cm3_helper_translate_curve_to_hw_format(plane_state->ctx,
&plane_state->in_shaper_func,
&dpp_base->shaper_params, true);
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 23/43] ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 22/43] drm/amd/display: remove assert around dpp_base replacement Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 24/43] io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs Greg Kroah-Hartman
` (29 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ziyi Guo, Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ziyi Guo <n7l8m4@u.northwestern.edu>
[ Upstream commit f514248727606b9087bc38a284ff686e0093abf1 ]
fsl_xcvr_activate_ctl() has
lockdep_assert_held(&card->snd_card->controls_rwsem),
but fsl_xcvr_mode_put() calls it without acquiring this lock.
Other callers of fsl_xcvr_activate_ctl() in fsl_xcvr_startup() and
fsl_xcvr_shutdown() properly acquire the lock with down_read()/up_read().
Add the missing down_read()/up_read() calls around fsl_xcvr_activate_ctl()
in fsl_xcvr_mode_put() to fix the lockdep assertion and prevent potential
race conditions when multiple userspace threads access the control.
Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Link: https://patch.msgid.link/20260202174112.2018402-1-n7l8m4@u.northwestern.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/fsl/fsl_xcvr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index 58db4906a01d5..51669e5fe8888 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -223,10 +223,13 @@ static int fsl_xcvr_mode_put(struct snd_kcontrol *kcontrol,
xcvr->mode = snd_soc_enum_item_to_val(e, item[0]);
+ down_read(&card->snd_card->controls_rwsem);
fsl_xcvr_activate_ctl(dai, fsl_xcvr_arc_mode_kctl.name,
(xcvr->mode == FSL_XCVR_MODE_ARC));
fsl_xcvr_activate_ctl(dai, fsl_xcvr_earc_capds_kctl.name,
(xcvr->mode == FSL_XCVR_MODE_EARC));
+ up_read(&card->snd_card->controls_rwsem);
+
/* Allow playback for SPDIF only */
rtd = snd_soc_get_pcm_runtime(card, card->dai_link);
rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count =
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 24/43] io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 23/43] ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put() Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 25/43] gpiolib: acpi: Fix gpio count with string references Greg Kroah-Hartman
` (28 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, 是参差,
Keith Busch, Jens Axboe, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
[ Upstream commit 38cfdd9dd279473a73814df9fd7e6e716951d361 ]
Add cond_resched() in those dump loops, just in case a lot of entries
are being dumped. And detect invalid CQ ring head/tail entries, to avoid
iterating more than what is necessary. Generally not an issue, but can be
if things like KASAN or other debugging metrics are enabled.
Reported-by: 是参差 <shicenci@gmail.com>
Link: https://lore.kernel.org/all/PS1PPF7E1D7501FE5631002D242DD89403FAB9BA@PS1PPF7E1D7501F.apcprd02.prod.outlook.com/
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/fdinfo.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
index 294c75a8a3bdb..3585ad8308504 100644
--- a/io_uring/fdinfo.c
+++ b/io_uring/fdinfo.c
@@ -65,7 +65,7 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
unsigned int cq_head = READ_ONCE(r->cq.head);
unsigned int cq_tail = READ_ONCE(r->cq.tail);
unsigned int sq_shift = 0;
- unsigned int sq_entries;
+ unsigned int cq_entries, sq_entries;
int sq_pid = -1, sq_cpu = -1;
u64 sq_total_time = 0, sq_work_time = 0;
unsigned int i;
@@ -119,9 +119,11 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
}
}
seq_printf(m, "\n");
+ cond_resched();
}
seq_printf(m, "CQEs:\t%u\n", cq_tail - cq_head);
- while (cq_head < cq_tail) {
+ cq_entries = min(cq_tail - cq_head, ctx->cq_entries);
+ for (i = 0; i < cq_entries; i++) {
struct io_uring_cqe *cqe;
bool cqe32 = false;
@@ -136,8 +138,11 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
cqe->big_cqe[0], cqe->big_cqe[1]);
seq_printf(m, "\n");
cq_head++;
- if (cqe32)
+ if (cqe32) {
cq_head++;
+ i++;
+ }
+ cond_resched();
}
if (ctx->flags & IORING_SETUP_SQPOLL) {
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 25/43] gpiolib: acpi: Fix gpio count with string references
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 24/43] io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 26/43] arm64: dts: mediatek: mt8183: Add missing endpoint IDs to display graph Greg Kroah-Hartman
` (27 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alban Bedel, Mika Westerberg,
Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alban Bedel <alban.bedel@lht.dlh.de>
[ Upstream commit c62e0658d458d8f100445445c3ddb106f3824a45 ]
Since commit 9880702d123f2 ("ACPI: property: Support using strings in
reference properties") it is possible to use strings instead of local
references. This work fine with single GPIO but not with arrays as
acpi_gpio_package_count() didn't handle this case. Update it to handle
strings like local references to cover this case as well.
Signed-off-by: Alban Bedel <alban.bedel@lht.dlh.de>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://patch.msgid.link/20260129145944.3372777-1-alban.bedel@lht.dlh.de
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib-acpi-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpiolib-acpi-core.c b/drivers/gpio/gpiolib-acpi-core.c
index e64e21fd6bbaa..8110690ea69d0 100644
--- a/drivers/gpio/gpiolib-acpi-core.c
+++ b/drivers/gpio/gpiolib-acpi-core.c
@@ -1359,6 +1359,7 @@ static int acpi_gpio_package_count(const union acpi_object *obj)
while (element < end) {
switch (element->type) {
case ACPI_TYPE_LOCAL_REFERENCE:
+ case ACPI_TYPE_STRING:
element += 3;
fallthrough;
case ACPI_TYPE_INTEGER:
--
2.51.0
^ permalink raw reply related [flat|nested] 55+ messages in thread
* [PATCH 6.18 26/43] arm64: dts: mediatek: mt8183: Add missing endpoint IDs to display graph
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 25/43] gpiolib: acpi: Fix gpio count with string references Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-03-04 7:03 ` Evans Jahja
2026-02-17 20:32 ` [PATCH 6.18 27/43] mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather Greg Kroah-Hartman
` (26 subsequent siblings)
52 siblings, 1 reply; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Evans Jahja, Chen-Yu Tsai,
Otto Pflüger, AngeloGioacchino Del Regno, Thorsten Leemhuis
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Otto Pflüger <otto.pflueger@abscue.de>
commit be0b304eeb8c5f77e4f98f64e58729d879195f2f upstream.
The endpoint IDs in the display graph are expected to match the
associated display path number, i.e. all endpoints connected to
mmsys_ep_main must have reg = <0> and all endpoints connected to
mmsys_ep_ext must have reg = <1>.
Add the missing ID to all endpoints in the display graph, based on
mt8365.dtsi as an existing example that does this correctly.
Fixes: e72d63fa0563 ("arm64: dts: mediatek: mt8183: Migrate to display controller OF graph")
Reported-by: Evans Jahja <evansjahja13@gmail.com>
Closes: https://lore.kernel.org/linux-mediatek/CAAq5pW9o3itC0G16LnJO7KMAQ_XoqXUpB=cuJ_7e3-H11zKd5Q@mail.gmail.com/
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
[Angelo: Fixed dtbs_check issues]
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Thorsten Leemhuis <regressions@leemhuis.info>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 37 +++++++++++++++++++++++++------
1 file changed, 31 insertions(+), 6 deletions(-)
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -1812,15 +1812,23 @@
#size-cells = <0>;
port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <0>;
- ovl_2l1_in: endpoint {
+
+ ovl_2l1_in: endpoint@1 {
+ reg = <1>;
remote-endpoint = <&mmsys_ep_ext>;
};
};
port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <1>;
- ovl_2l1_out: endpoint {
+
+ ovl_2l1_out: endpoint@1 {
+ reg = <1>;
remote-endpoint = <&rdma1_in>;
};
};
@@ -1872,15 +1880,23 @@
#size-cells = <0>;
port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <0>;
- rdma1_in: endpoint {
+
+ rdma1_in: endpoint@1 {
+ reg = <1>;
remote-endpoint = <&ovl_2l1_out>;
};
};
port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <1>;
- rdma1_out: endpoint {
+
+ rdma1_out: endpoint@1 {
+ reg = <1>;
remote-endpoint = <&dpi_in>;
};
};
@@ -2076,15 +2092,24 @@
#size-cells = <0>;
port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <0>;
- dpi_in: endpoint {
+
+ dpi_in: endpoint@1 {
+ reg = <1>;
remote-endpoint = <&rdma1_out>;
};
};
port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <1>;
- dpi_out: endpoint { };
+
+ dpi_out: endpoint@1 {
+ reg = <1>;
+ };
};
};
};
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 27/43] mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 26/43] arm64: dts: mediatek: mt8183: Add missing endpoint IDs to display graph Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 28/43] LoongArch: Rework KASAN initialization for PTW-enabled systems Greg Kroah-Hartman
` (25 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Hildenbrand (Red Hat),
Uschakow, Stanislav, Laurence Oberman, Harry Yoo, Lorenzo Stoakes,
Lance Yang, Liu Shixin, Oscar Salvador, Rik van Riel,
Andrew Morton
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Red Hat) <david@kernel.org>
commit 8ce720d5bd91e9dc16db3604aa4b1bf76770a9a1 upstream.
As reported, ever since commit 1013af4f585f ("mm/hugetlb: fix
huge_pmd_unshare() vs GUP-fast race") we can end up in some situations
where we perform so many IPI broadcasts when unsharing hugetlb PMD page
tables that it severely regresses some workloads.
In particular, when we fork()+exit(), or when we munmap() a large
area backed by many shared PMD tables, we perform one IPI broadcast per
unshared PMD table.
There are two optimizations to be had:
(1) When we process (unshare) multiple such PMD tables, such as during
exit(), it is sufficient to send a single IPI broadcast (as long as
we respect locking rules) instead of one per PMD table.
Locking prevents that any of these PMD tables could get reused before
we drop the lock.
(2) When we are not the last sharer (> 2 users including us), there is
no need to send the IPI broadcast. The shared PMD tables cannot
become exclusive (fully unshared) before an IPI will be broadcasted
by the last sharer.
Concurrent GUP-fast could walk into a PMD table just before we
unshared it. It could then succeed in grabbing a page from the
shared page table even after munmap() etc succeeded (and supressed
an IPI). But there is not difference compared to GUP-fast just
sleeping for a while after grabbing the page and re-enabling IRQs.
Most importantly, GUP-fast will never walk into page tables that are
no-longer shared, because the last sharer will issue an IPI
broadcast.
(if ever required, checking whether the PUD changed in GUP-fast
after grabbing the page like we do in the PTE case could handle
this)
So let's rework PMD sharing TLB flushing + IPI sync to use the mmu_gather
infrastructure so we can implement these optimizations and demystify the
code at least a bit. Extend the mmu_gather infrastructure to be able to
deal with our special hugetlb PMD table sharing implementation.
To make initialization of the mmu_gather easier when working on a single
VMA (in particular, when dealing with hugetlb), provide
tlb_gather_mmu_vma().
We'll consolidate the handling for (full) unsharing of PMD tables in
tlb_unshare_pmd_ptdesc() and tlb_flush_unshared_tables(), and track
in "struct mmu_gather" whether we had (full) unsharing of PMD tables.
Because locking is very special (concurrent unsharing+reuse must be
prevented), we disallow deferring flushing to tlb_finish_mmu() and instead
require an explicit earlier call to tlb_flush_unshared_tables().
>From hugetlb code, we call huge_pmd_unshare_flush() where we make sure
that the expected lock protecting us from concurrent unsharing+reuse is
still held.
Check with a VM_WARN_ON_ONCE() in tlb_finish_mmu() that
tlb_flush_unshared_tables() was properly called earlier.
Document it all properly.
Notes about tlb_remove_table_sync_one() interaction with unsharing:
There are two fairly tricky things:
(1) tlb_remove_table_sync_one() is a NOP on architectures without
CONFIG_MMU_GATHER_RCU_TABLE_FREE.
Here, the assumption is that the previous TLB flush would send an
IPI to all relevant CPUs. Careful: some architectures like x86 only
send IPIs to all relevant CPUs when tlb->freed_tables is set.
The relevant architectures should be selecting
MMU_GATHER_RCU_TABLE_FREE, but x86 might not do that in stable
kernels and it might have been problematic before this patch.
Also, the arch flushing behavior (independent of IPIs) is different
when tlb->freed_tables is set. Do we have to enlighten them to also
take care of tlb->unshared_tables? So far we didn't care, so
hopefully we are fine. Of course, we could be setting
tlb->freed_tables as well, but that might then unnecessarily flush
too much, because the semantics of tlb->freed_tables are a bit
fuzzy.
This patch changes nothing in this regard.
(2) tlb_remove_table_sync_one() is not a NOP on architectures with
CONFIG_MMU_GATHER_RCU_TABLE_FREE that actually don't need a sync.
Take x86 as an example: in the common case (!pv, !X86_FEATURE_INVLPGB)
we still issue IPIs during TLB flushes and don't actually need the
second tlb_remove_table_sync_one().
This optimized can be implemented on top of this, by checking e.g., in
tlb_remove_table_sync_one() whether we really need IPIs. But as
described in (1), it really must honor tlb->freed_tables then to
send IPIs to all relevant CPUs.
Notes on TLB flushing changes:
(1) Flushing for non-shared PMD tables
We're converting from flush_hugetlb_tlb_range() to
tlb_remove_huge_tlb_entry(). Given that we properly initialize the
MMU gather in tlb_gather_mmu_vma() to be hugetlb aware, similar to
__unmap_hugepage_range(), that should be fine.
(2) Flushing for shared PMD tables
We're converting from various things (flush_hugetlb_tlb_range(),
tlb_flush_pmd_range(), flush_tlb_range()) to tlb_flush_pmd_range().
tlb_flush_pmd_range() achieves the same that
tlb_remove_huge_tlb_entry() would achieve in these scenarios.
Note that tlb_remove_huge_tlb_entry() also calls
__tlb_remove_tlb_entry(), however that is only implemented on
powerpc, which does not support PMD table sharing.
Similar to (1), tlb_gather_mmu_vma() should make sure that TLB
flushing keeps on working as expected.
Further, note that the ptdesc_pmd_pts_dec() in huge_pmd_share() is not a
concern, as we are holding the i_mmap_lock the whole time, preventing
concurrent unsharing. That ptdesc_pmd_pts_dec() usage will be removed
separately as a cleanup later.
There are plenty more cleanups to be had, but they have to wait until
this is fixed.
[david@kernel.org: fix kerneldoc]
Link: https://lkml.kernel.org/r/f223dd74-331c-412d-93fc-69e360a5006c@kernel.org
Link: https://lkml.kernel.org/r/20251223214037.580860-5-david@kernel.org
Fixes: 1013af4f585f ("mm/hugetlb: fix huge_pmd_unshare() vs GUP-fast race")
Signed-off-by: David Hildenbrand (Red Hat) <david@kernel.org>
Reported-by: "Uschakow, Stanislav" <suschako@amazon.de>
Closes: https://lore.kernel.org/all/4d3878531c76479d9f8ca9789dc6485d@amazon.de/
Tested-by: Laurence Oberman <loberman@redhat.com>
Acked-by: Harry Yoo <harry.yoo@oracle.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Liu Shixin <liushixin2@huawei.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Rik van Riel <riel@surriel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/asm-generic/tlb.h | 77 ++++++++++++++++++++++++++++
include/linux/hugetlb.h | 15 +++--
include/linux/mm_types.h | 1
mm/hugetlb.c | 123 ++++++++++++++++++++++++++--------------------
mm/mmu_gather.c | 33 ++++++++++++
mm/rmap.c | 25 ++++++---
6 files changed, 208 insertions(+), 66 deletions(-)
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -46,7 +46,8 @@
*
* The mmu_gather API consists of:
*
- * - tlb_gather_mmu() / tlb_gather_mmu_fullmm() / tlb_finish_mmu()
+ * - tlb_gather_mmu() / tlb_gather_mmu_fullmm() / tlb_gather_mmu_vma() /
+ * tlb_finish_mmu()
*
* start and finish a mmu_gather
*
@@ -364,6 +365,20 @@ struct mmu_gather {
unsigned int vma_huge : 1;
unsigned int vma_pfn : 1;
+ /*
+ * Did we unshare (unmap) any shared page tables? For now only
+ * used for hugetlb PMD table sharing.
+ */
+ unsigned int unshared_tables : 1;
+
+ /*
+ * Did we unshare any page tables such that they are now exclusive
+ * and could get reused+modified by the new owner? When setting this
+ * flag, "unshared_tables" will be set as well. For now only used
+ * for hugetlb PMD table sharing.
+ */
+ unsigned int fully_unshared_tables : 1;
+
unsigned int batch_count;
#ifndef CONFIG_MMU_GATHER_NO_GATHER
@@ -400,6 +415,7 @@ static inline void __tlb_reset_range(str
tlb->cleared_pmds = 0;
tlb->cleared_puds = 0;
tlb->cleared_p4ds = 0;
+ tlb->unshared_tables = 0;
/*
* Do not reset mmu_gather::vma_* fields here, we do not
* call into tlb_start_vma() again to set them if there is an
@@ -484,7 +500,7 @@ static inline void tlb_flush_mmu_tlbonly
* these bits.
*/
if (!(tlb->freed_tables || tlb->cleared_ptes || tlb->cleared_pmds ||
- tlb->cleared_puds || tlb->cleared_p4ds))
+ tlb->cleared_puds || tlb->cleared_p4ds || tlb->unshared_tables))
return;
tlb_flush(tlb);
@@ -773,6 +789,63 @@ static inline bool huge_pmd_needs_flush(
}
#endif
+#ifdef CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING
+static inline void tlb_unshare_pmd_ptdesc(struct mmu_gather *tlb, struct ptdesc *pt,
+ unsigned long addr)
+{
+ /*
+ * The caller must make sure that concurrent unsharing + exclusive
+ * reuse is impossible until tlb_flush_unshared_tables() was called.
+ */
+ VM_WARN_ON_ONCE(!ptdesc_pmd_is_shared(pt));
+ ptdesc_pmd_pts_dec(pt);
+
+ /* Clearing a PUD pointing at a PMD table with PMD leaves. */
+ tlb_flush_pmd_range(tlb, addr & PUD_MASK, PUD_SIZE);
+
+ /*
+ * If the page table is now exclusively owned, we fully unshared
+ * a page table.
+ */
+ if (!ptdesc_pmd_is_shared(pt))
+ tlb->fully_unshared_tables = true;
+ tlb->unshared_tables = true;
+}
+
+static inline void tlb_flush_unshared_tables(struct mmu_gather *tlb)
+{
+ /*
+ * As soon as the caller drops locks to allow for reuse of
+ * previously-shared tables, these tables could get modified and
+ * even reused outside of hugetlb context, so we have to make sure that
+ * any page table walkers (incl. TLB, GUP-fast) are aware of that
+ * change.
+ *
+ * Even if we are not fully unsharing a PMD table, we must
+ * flush the TLB for the unsharer now.
+ */
+ if (tlb->unshared_tables)
+ tlb_flush_mmu_tlbonly(tlb);
+
+ /*
+ * Similarly, we must make sure that concurrent GUP-fast will not
+ * walk previously-shared page tables that are getting modified+reused
+ * elsewhere. So broadcast an IPI to wait for any concurrent GUP-fast.
+ *
+ * We only perform this when we are the last sharer of a page table,
+ * as the IPI will reach all CPUs: any GUP-fast.
+ *
+ * Note that on configs where tlb_remove_table_sync_one() is a NOP,
+ * the expectation is that the tlb_flush_mmu_tlbonly() would have issued
+ * required IPIs already for us.
+ */
+ if (tlb->fully_unshared_tables) {
+ tlb_remove_table_sync_one();
+ tlb->fully_unshared_tables = false;
+ }
+}
+#endif /* CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING */
+
#endif /* CONFIG_MMU */
#endif /* _ASM_GENERIC__TLB_H */
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -241,8 +241,9 @@ pte_t *huge_pte_alloc(struct mm_struct *
pte_t *huge_pte_offset(struct mm_struct *mm,
unsigned long addr, unsigned long sz);
unsigned long hugetlb_mask_last_page(struct hstate *h);
-int huge_pmd_unshare(struct mm_struct *mm, struct vm_area_struct *vma,
- unsigned long addr, pte_t *ptep);
+int huge_pmd_unshare(struct mmu_gather *tlb, struct vm_area_struct *vma,
+ unsigned long addr, pte_t *ptep);
+void huge_pmd_unshare_flush(struct mmu_gather *tlb, struct vm_area_struct *vma);
void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
unsigned long *start, unsigned long *end);
@@ -302,13 +303,17 @@ static inline struct address_space *huge
return NULL;
}
-static inline int huge_pmd_unshare(struct mm_struct *mm,
- struct vm_area_struct *vma,
- unsigned long addr, pte_t *ptep)
+static inline int huge_pmd_unshare(struct mmu_gather *tlb,
+ struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
{
return 0;
}
+static inline void huge_pmd_unshare_flush(struct mmu_gather *tlb,
+ struct vm_area_struct *vma)
+{
+}
+
static inline void adjust_range_if_pmd_sharing_possible(
struct vm_area_struct *vma,
unsigned long *start, unsigned long *end)
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -1490,6 +1490,7 @@ static inline void mm_set_cpus_allowed(s
struct mmu_gather;
extern void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm);
extern void tlb_gather_mmu_fullmm(struct mmu_gather *tlb, struct mm_struct *mm);
+void tlb_gather_mmu_vma(struct mmu_gather *tlb, struct vm_area_struct *vma);
extern void tlb_finish_mmu(struct mmu_gather *tlb);
struct vm_fault;
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -5797,7 +5797,7 @@ int move_hugetlb_page_tables(struct vm_a
unsigned long last_addr_mask;
pte_t *src_pte, *dst_pte;
struct mmu_notifier_range range;
- bool shared_pmd = false;
+ struct mmu_gather tlb;
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, mm, old_addr,
old_end);
@@ -5807,6 +5807,7 @@ int move_hugetlb_page_tables(struct vm_a
* range.
*/
flush_cache_range(vma, range.start, range.end);
+ tlb_gather_mmu_vma(&tlb, vma);
mmu_notifier_invalidate_range_start(&range);
last_addr_mask = hugetlb_mask_last_page(h);
@@ -5823,8 +5824,7 @@ int move_hugetlb_page_tables(struct vm_a
if (huge_pte_none(huge_ptep_get(mm, old_addr, src_pte)))
continue;
- if (huge_pmd_unshare(mm, vma, old_addr, src_pte)) {
- shared_pmd = true;
+ if (huge_pmd_unshare(&tlb, vma, old_addr, src_pte)) {
old_addr |= last_addr_mask;
new_addr |= last_addr_mask;
continue;
@@ -5835,15 +5835,16 @@ int move_hugetlb_page_tables(struct vm_a
break;
move_huge_pte(vma, old_addr, new_addr, src_pte, dst_pte, sz);
+ tlb_remove_huge_tlb_entry(h, &tlb, src_pte, old_addr);
}
- if (shared_pmd)
- flush_hugetlb_tlb_range(vma, range.start, range.end);
- else
- flush_hugetlb_tlb_range(vma, old_end - len, old_end);
+ tlb_flush_mmu_tlbonly(&tlb);
+ huge_pmd_unshare_flush(&tlb, vma);
+
mmu_notifier_invalidate_range_end(&range);
i_mmap_unlock_write(mapping);
hugetlb_vma_unlock_write(vma);
+ tlb_finish_mmu(&tlb);
return len + old_addr - old_end;
}
@@ -5862,7 +5863,6 @@ void __unmap_hugepage_range(struct mmu_g
unsigned long sz = huge_page_size(h);
bool adjust_reservation;
unsigned long last_addr_mask;
- bool force_flush = false;
WARN_ON(!is_vm_hugetlb_page(vma));
BUG_ON(start & ~huge_page_mask(h));
@@ -5885,10 +5885,8 @@ void __unmap_hugepage_range(struct mmu_g
}
ptl = huge_pte_lock(h, mm, ptep);
- if (huge_pmd_unshare(mm, vma, address, ptep)) {
+ if (huge_pmd_unshare(tlb, vma, address, ptep)) {
spin_unlock(ptl);
- tlb_flush_pmd_range(tlb, address & PUD_MASK, PUD_SIZE);
- force_flush = true;
address |= last_addr_mask;
continue;
}
@@ -6004,14 +6002,7 @@ void __unmap_hugepage_range(struct mmu_g
}
tlb_end_vma(tlb, vma);
- /*
- * There is nothing protecting a previously-shared page table that we
- * unshared through huge_pmd_unshare() from getting freed after we
- * release i_mmap_rwsem, so flush the TLB now. If huge_pmd_unshare()
- * succeeded, flush the range corresponding to the pud.
- */
- if (force_flush)
- tlb_flush_mmu_tlbonly(tlb);
+ huge_pmd_unshare_flush(tlb, vma);
}
void __hugetlb_zap_begin(struct vm_area_struct *vma,
@@ -7104,11 +7095,11 @@ long hugetlb_change_protection(struct vm
pte_t pte;
struct hstate *h = hstate_vma(vma);
long pages = 0, psize = huge_page_size(h);
- bool shared_pmd = false;
struct mmu_notifier_range range;
unsigned long last_addr_mask;
bool uffd_wp = cp_flags & MM_CP_UFFD_WP;
bool uffd_wp_resolve = cp_flags & MM_CP_UFFD_WP_RESOLVE;
+ struct mmu_gather tlb;
/*
* In the case of shared PMDs, the area to flush could be beyond
@@ -7121,6 +7112,7 @@ long hugetlb_change_protection(struct vm
BUG_ON(address >= end);
flush_cache_range(vma, range.start, range.end);
+ tlb_gather_mmu_vma(&tlb, vma);
mmu_notifier_invalidate_range_start(&range);
hugetlb_vma_lock_write(vma);
@@ -7145,7 +7137,7 @@ long hugetlb_change_protection(struct vm
}
}
ptl = huge_pte_lock(h, mm, ptep);
- if (huge_pmd_unshare(mm, vma, address, ptep)) {
+ if (huge_pmd_unshare(&tlb, vma, address, ptep)) {
/*
* When uffd-wp is enabled on the vma, unshare
* shouldn't happen at all. Warn about it if it
@@ -7154,7 +7146,6 @@ long hugetlb_change_protection(struct vm
WARN_ON_ONCE(uffd_wp || uffd_wp_resolve);
pages++;
spin_unlock(ptl);
- shared_pmd = true;
address |= last_addr_mask;
continue;
}
@@ -7206,6 +7197,7 @@ long hugetlb_change_protection(struct vm
pte = huge_pte_clear_uffd_wp(pte);
huge_ptep_modify_prot_commit(vma, address, ptep, old_pte, pte);
pages++;
+ tlb_remove_huge_tlb_entry(h, &tlb, ptep, address);
} else {
/* None pte */
if (unlikely(uffd_wp))
@@ -7218,16 +7210,9 @@ long hugetlb_change_protection(struct vm
cond_resched();
}
- /*
- * There is nothing protecting a previously-shared page table that we
- * unshared through huge_pmd_unshare() from getting freed after we
- * release i_mmap_rwsem, so flush the TLB now. If huge_pmd_unshare()
- * succeeded, flush the range corresponding to the pud.
- */
- if (shared_pmd)
- flush_hugetlb_tlb_range(vma, range.start, range.end);
- else
- flush_hugetlb_tlb_range(vma, start, end);
+
+ tlb_flush_mmu_tlbonly(&tlb);
+ huge_pmd_unshare_flush(&tlb, vma);
/*
* No need to call mmu_notifier_arch_invalidate_secondary_tlbs() we are
* downgrading page table protection not changing it to point to a new
@@ -7238,6 +7223,7 @@ long hugetlb_change_protection(struct vm
i_mmap_unlock_write(vma->vm_file->f_mapping);
hugetlb_vma_unlock_write(vma);
mmu_notifier_invalidate_range_end(&range);
+ tlb_finish_mmu(&tlb);
return pages > 0 ? (pages << h->order) : pages;
}
@@ -7590,18 +7576,27 @@ out:
return pte;
}
-/*
- * unmap huge page backed by shared pte.
+/**
+ * huge_pmd_unshare - Unmap a pmd table if it is shared by multiple users
+ * @tlb: the current mmu_gather.
+ * @vma: the vma covering the pmd table.
+ * @addr: the address we are trying to unshare.
+ * @ptep: pointer into the (pmd) page table.
+ *
+ * Called with the page table lock held, the i_mmap_rwsem held in write mode
+ * and the hugetlb vma lock held in write mode.
*
- * Called with page table lock held.
+ * Note: The caller must call huge_pmd_unshare_flush() before dropping the
+ * i_mmap_rwsem.
*
- * returns: 1 successfully unmapped a shared pte page
- * 0 the underlying pte page is not shared, or it is the last user
+ * Returns: 1 if it was a shared PMD table and it got unmapped, or 0 if it
+ * was not a shared PMD table.
*/
-int huge_pmd_unshare(struct mm_struct *mm, struct vm_area_struct *vma,
- unsigned long addr, pte_t *ptep)
+int huge_pmd_unshare(struct mmu_gather *tlb, struct vm_area_struct *vma,
+ unsigned long addr, pte_t *ptep)
{
unsigned long sz = huge_page_size(hstate_vma(vma));
+ struct mm_struct *mm = vma->vm_mm;
pgd_t *pgd = pgd_offset(mm, addr);
p4d_t *p4d = p4d_offset(pgd, addr);
pud_t *pud = pud_offset(p4d, addr);
@@ -7613,18 +7608,36 @@ int huge_pmd_unshare(struct mm_struct *m
i_mmap_assert_write_locked(vma->vm_file->f_mapping);
hugetlb_vma_assert_locked(vma);
pud_clear(pud);
- /*
- * Once our caller drops the rmap lock, some other process might be
- * using this page table as a normal, non-hugetlb page table.
- * Wait for pending gup_fast() in other threads to finish before letting
- * that happen.
- */
- tlb_remove_table_sync_one();
- ptdesc_pmd_pts_dec(virt_to_ptdesc(ptep));
+
+ tlb_unshare_pmd_ptdesc(tlb, virt_to_ptdesc(ptep), addr);
+
mm_dec_nr_pmds(mm);
return 1;
}
+/*
+ * huge_pmd_unshare_flush - Complete a sequence of huge_pmd_unshare() calls
+ * @tlb: the current mmu_gather.
+ * @vma: the vma covering the pmd table.
+ *
+ * Perform necessary TLB flushes or IPI broadcasts to synchronize PMD table
+ * unsharing with concurrent page table walkers.
+ *
+ * This function must be called after a sequence of huge_pmd_unshare()
+ * calls while still holding the i_mmap_rwsem.
+ */
+void huge_pmd_unshare_flush(struct mmu_gather *tlb, struct vm_area_struct *vma)
+{
+ /*
+ * We must synchronize page table unsharing such that nobody will
+ * try reusing a previously-shared page table while it might still
+ * be in use by previous sharers (TLB, GUP_fast).
+ */
+ i_mmap_assert_write_locked(vma->vm_file->f_mapping);
+
+ tlb_flush_unshared_tables(tlb);
+}
+
#else /* !CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING */
pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
@@ -7633,12 +7646,16 @@ pte_t *huge_pmd_share(struct mm_struct *
return NULL;
}
-int huge_pmd_unshare(struct mm_struct *mm, struct vm_area_struct *vma,
- unsigned long addr, pte_t *ptep)
+int huge_pmd_unshare(struct mmu_gather *tlb, struct vm_area_struct *vma,
+ unsigned long addr, pte_t *ptep)
{
return 0;
}
+void huge_pmd_unshare_flush(struct mmu_gather *tlb, struct vm_area_struct *vma)
+{
+}
+
void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
unsigned long *start, unsigned long *end)
{
@@ -7905,6 +7922,7 @@ static void hugetlb_unshare_pmds(struct
unsigned long sz = huge_page_size(h);
struct mm_struct *mm = vma->vm_mm;
struct mmu_notifier_range range;
+ struct mmu_gather tlb;
unsigned long address;
spinlock_t *ptl;
pte_t *ptep;
@@ -7916,6 +7934,8 @@ static void hugetlb_unshare_pmds(struct
return;
flush_cache_range(vma, start, end);
+ tlb_gather_mmu_vma(&tlb, vma);
+
/*
* No need to call adjust_range_if_pmd_sharing_possible(), because
* we have already done the PUD_SIZE alignment.
@@ -7934,10 +7954,10 @@ static void hugetlb_unshare_pmds(struct
if (!ptep)
continue;
ptl = huge_pte_lock(h, mm, ptep);
- huge_pmd_unshare(mm, vma, address, ptep);
+ huge_pmd_unshare(&tlb, vma, address, ptep);
spin_unlock(ptl);
}
- flush_hugetlb_tlb_range(vma, start, end);
+ huge_pmd_unshare_flush(&tlb, vma);
if (take_locks) {
i_mmap_unlock_write(vma->vm_file->f_mapping);
hugetlb_vma_unlock_write(vma);
@@ -7947,6 +7967,7 @@ static void hugetlb_unshare_pmds(struct
* Documentation/mm/mmu_notifier.rst.
*/
mmu_notifier_invalidate_range_end(&range);
+ tlb_finish_mmu(&tlb);
}
/*
--- a/mm/mmu_gather.c
+++ b/mm/mmu_gather.c
@@ -9,6 +9,7 @@
#include <linux/smp.h>
#include <linux/swap.h>
#include <linux/rmap.h>
+#include <linux/hugetlb.h>
#include <asm/pgalloc.h>
#include <asm/tlb.h>
@@ -426,6 +427,7 @@ static void __tlb_gather_mmu(struct mmu_
#endif
tlb->vma_pfn = 0;
+ tlb->fully_unshared_tables = 0;
__tlb_reset_range(tlb);
inc_tlb_flush_pending(tlb->mm);
}
@@ -460,6 +462,31 @@ void tlb_gather_mmu_fullmm(struct mmu_ga
}
/**
+ * tlb_gather_mmu_vma - initialize an mmu_gather structure for operating on a
+ * single VMA
+ * @tlb: the mmu_gather structure to initialize
+ * @vma: the vm_area_struct
+ *
+ * Called to initialize an (on-stack) mmu_gather structure for operating on
+ * a single VMA. In contrast to tlb_gather_mmu(), calling this function will
+ * not require another call to tlb_start_vma(). In contrast to tlb_start_vma(),
+ * this function will *not* call flush_cache_range().
+ *
+ * For hugetlb VMAs, this function will also initialize the mmu_gather
+ * page_size accordingly, not requiring a separate call to
+ * tlb_change_page_size().
+ *
+ */
+void tlb_gather_mmu_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
+{
+ tlb_gather_mmu(tlb, vma->vm_mm);
+ tlb_update_vma_flags(tlb, vma);
+ if (is_vm_hugetlb_page(vma))
+ /* All entries have the same size. */
+ tlb_change_page_size(tlb, huge_page_size(hstate_vma(vma)));
+}
+
+/**
* tlb_finish_mmu - finish an mmu_gather structure
* @tlb: the mmu_gather structure to finish
*
@@ -469,6 +496,12 @@ void tlb_gather_mmu_fullmm(struct mmu_ga
void tlb_finish_mmu(struct mmu_gather *tlb)
{
/*
+ * We expect an earlier huge_pmd_unshare_flush() call to sort this out,
+ * due to complicated locking requirements with page table unsharing.
+ */
+ VM_WARN_ON_ONCE(tlb->fully_unshared_tables);
+
+ /*
* If there are parallel threads are doing PTE changes on same range
* under non-exclusive lock (e.g., mmap_lock read-side) but defer TLB
* flush by batching, one thread may end up seeing inconsistent PTEs
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -76,7 +76,7 @@
#include <linux/mm_inline.h>
#include <linux/oom.h>
-#include <asm/tlbflush.h>
+#include <asm/tlb.h>
#define CREATE_TRACE_POINTS
#include <trace/events/migrate.h>
@@ -2019,13 +2019,17 @@ static bool try_to_unmap_one(struct foli
* if unsuccessful.
*/
if (!anon) {
+ struct mmu_gather tlb;
+
VM_BUG_ON(!(flags & TTU_RMAP_LOCKED));
if (!hugetlb_vma_trylock_write(vma))
goto walk_abort;
- if (huge_pmd_unshare(mm, vma, address, pvmw.pte)) {
+
+ tlb_gather_mmu_vma(&tlb, vma);
+ if (huge_pmd_unshare(&tlb, vma, address, pvmw.pte)) {
hugetlb_vma_unlock_write(vma);
- flush_tlb_range(vma,
- range.start, range.end);
+ huge_pmd_unshare_flush(&tlb, vma);
+ tlb_finish_mmu(&tlb);
/*
* The PMD table was unmapped,
* consequently unmapping the folio.
@@ -2033,6 +2037,7 @@ static bool try_to_unmap_one(struct foli
goto walk_done;
}
hugetlb_vma_unlock_write(vma);
+ tlb_finish_mmu(&tlb);
}
pteval = huge_ptep_clear_flush(vma, address, pvmw.pte);
if (pte_dirty(pteval))
@@ -2398,17 +2403,20 @@ static bool try_to_migrate_one(struct fo
* fail if unsuccessful.
*/
if (!anon) {
+ struct mmu_gather tlb;
+
VM_BUG_ON(!(flags & TTU_RMAP_LOCKED));
if (!hugetlb_vma_trylock_write(vma)) {
page_vma_mapped_walk_done(&pvmw);
ret = false;
break;
}
- if (huge_pmd_unshare(mm, vma, address, pvmw.pte)) {
- hugetlb_vma_unlock_write(vma);
- flush_tlb_range(vma,
- range.start, range.end);
+ tlb_gather_mmu_vma(&tlb, vma);
+ if (huge_pmd_unshare(&tlb, vma, address, pvmw.pte)) {
+ hugetlb_vma_unlock_write(vma);
+ huge_pmd_unshare_flush(&tlb, vma);
+ tlb_finish_mmu(&tlb);
/*
* The PMD table was unmapped,
* consequently unmapping the folio.
@@ -2417,6 +2425,7 @@ static bool try_to_migrate_one(struct fo
break;
}
hugetlb_vma_unlock_write(vma);
+ tlb_finish_mmu(&tlb);
}
/* Nuke the hugetlb page table entry */
pteval = huge_ptep_clear_flush(vma, address, pvmw.pte);
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 28/43] LoongArch: Rework KASAN initialization for PTW-enabled systems
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 27/43] mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 29/43] cpuset: Fix missing adaptation for cpuset_is_populated Greg Kroah-Hartman
` (24 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tiezhu Yang, Huacai Chen
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiezhu Yang <yangtiezhu@loongson.cn>
commit 5ec5ac4ca27e4daa234540ac32f9fc5219377d53 upstream.
kasan_init_generic() indicates that kasan is fully initialized, so it
should be put at end of kasan_init().
Otherwise bringing up the primary CPU failed when CONFIG_KASAN is set
on PTW-enabled systems, here are the call chains:
kernel_entry()
start_kernel()
setup_arch()
kasan_init()
kasan_init_generic()
The reason is PTW-enabled systems have speculative accesses which means
memory accesses to the shadow memory after kasan_init() may be executed
by hardware before. However, accessing shadow memory is safe only after
kasan fully initialized because kasan_init() uses a temporary PGD table
until we have populated all levels of shadow page tables and writen the
PGD register. Moving kasan_init_generic() later can defer the occasion
of kasan_enabled(), so as to avoid speculative accesses on shadow pages.
After moving kasan_init_generic() to the end, kasan_init() can no longer
call kasan_mem_to_shadow() for shadow address conversion because it will
always return kasan_early_shadow_page. On the other hand, we should keep
the current logic of kasan_mem_to_shadow() for both the early and final
stage because there may be instrumentation before kasan_init().
To solve this, we factor out a new mem_to_shadow() function from current
kasan_mem_to_shadow() for the shadow address conversion in kasan_init().
Cc: stable@vger.kernel.org
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/loongarch/mm/kasan_init.c | 78 +++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 38 deletions(-)
--- a/arch/loongarch/mm/kasan_init.c
+++ b/arch/loongarch/mm/kasan_init.c
@@ -40,39 +40,43 @@ static pgd_t kasan_pg_dir[PTRS_PER_PGD]
#define __pte_none(early, pte) (early ? pte_none(pte) : \
((pte_val(pte) & _PFN_MASK) == (unsigned long)__pa(kasan_early_shadow_page)))
-void *kasan_mem_to_shadow(const void *addr)
+static void *mem_to_shadow(const void *addr)
{
- if (!kasan_enabled()) {
+ unsigned long offset = 0;
+ unsigned long maddr = (unsigned long)addr;
+ unsigned long xrange = (maddr >> XRANGE_SHIFT) & 0xffff;
+
+ if (maddr >= FIXADDR_START)
return (void *)(kasan_early_shadow_page);
- } else {
- unsigned long maddr = (unsigned long)addr;
- unsigned long xrange = (maddr >> XRANGE_SHIFT) & 0xffff;
- unsigned long offset = 0;
-
- if (maddr >= FIXADDR_START)
- return (void *)(kasan_early_shadow_page);
-
- maddr &= XRANGE_SHADOW_MASK;
- switch (xrange) {
- case XKPRANGE_CC_SEG:
- offset = XKPRANGE_CC_SHADOW_OFFSET;
- break;
- case XKPRANGE_UC_SEG:
- offset = XKPRANGE_UC_SHADOW_OFFSET;
- break;
- case XKPRANGE_WC_SEG:
- offset = XKPRANGE_WC_SHADOW_OFFSET;
- break;
- case XKVRANGE_VC_SEG:
- offset = XKVRANGE_VC_SHADOW_OFFSET;
- break;
- default:
- WARN_ON(1);
- return NULL;
- }
- return (void *)((maddr >> KASAN_SHADOW_SCALE_SHIFT) + offset);
+ maddr &= XRANGE_SHADOW_MASK;
+ switch (xrange) {
+ case XKPRANGE_CC_SEG:
+ offset = XKPRANGE_CC_SHADOW_OFFSET;
+ break;
+ case XKPRANGE_UC_SEG:
+ offset = XKPRANGE_UC_SHADOW_OFFSET;
+ break;
+ case XKPRANGE_WC_SEG:
+ offset = XKPRANGE_WC_SHADOW_OFFSET;
+ break;
+ case XKVRANGE_VC_SEG:
+ offset = XKVRANGE_VC_SHADOW_OFFSET;
+ break;
+ default:
+ WARN_ON(1);
+ return NULL;
}
+
+ return (void *)((maddr >> KASAN_SHADOW_SCALE_SHIFT) + offset);
+}
+
+void *kasan_mem_to_shadow(const void *addr)
+{
+ if (kasan_enabled())
+ return mem_to_shadow(addr);
+ else
+ return (void *)(kasan_early_shadow_page);
}
const void *kasan_shadow_to_mem(const void *shadow_addr)
@@ -293,11 +297,8 @@ void __init kasan_init(void)
/* Maps everything to a single page of zeroes */
kasan_pgd_populate(KASAN_SHADOW_START, KASAN_SHADOW_END, NUMA_NO_NODE, true);
- kasan_populate_early_shadow(kasan_mem_to_shadow((void *)VMALLOC_START),
- kasan_mem_to_shadow((void *)KFENCE_AREA_END));
-
- /* Enable KASAN here before kasan_mem_to_shadow(). */
- kasan_init_generic();
+ kasan_populate_early_shadow(mem_to_shadow((void *)VMALLOC_START),
+ mem_to_shadow((void *)KFENCE_AREA_END));
/* Populate the linear mapping */
for_each_mem_range(i, &pa_start, &pa_end) {
@@ -307,13 +308,13 @@ void __init kasan_init(void)
if (start >= end)
break;
- kasan_map_populate((unsigned long)kasan_mem_to_shadow(start),
- (unsigned long)kasan_mem_to_shadow(end), NUMA_NO_NODE);
+ kasan_map_populate((unsigned long)mem_to_shadow(start),
+ (unsigned long)mem_to_shadow(end), NUMA_NO_NODE);
}
/* Populate modules mapping */
- kasan_map_populate((unsigned long)kasan_mem_to_shadow((void *)MODULES_VADDR),
- (unsigned long)kasan_mem_to_shadow((void *)MODULES_END), NUMA_NO_NODE);
+ kasan_map_populate((unsigned long)mem_to_shadow((void *)MODULES_VADDR),
+ (unsigned long)mem_to_shadow((void *)MODULES_END), NUMA_NO_NODE);
/*
* KAsan may reuse the contents of kasan_early_shadow_pte directly, so we
* should make sure that it maps the zero page read-only.
@@ -328,4 +329,5 @@ void __init kasan_init(void)
/* At this point kasan is fully initialized. Enable error messages */
init_task.kasan_depth = 0;
+ kasan_init_generic();
}
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 29/43] cpuset: Fix missing adaptation for cpuset_is_populated
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 28/43] LoongArch: Rework KASAN initialization for PTW-enabled systems Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 30/43] fbdev: rivafb: fix divide error in nv3_arb() Greg Kroah-Hartman
` (23 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Waiman Long, Tejun Heo, Chen Ridong
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ridong <chenridong@huawei.com>
Commit b1bcaed1e39a ("cpuset: Treat cpusets in attaching as populated")
was backported to the long‑term support (LTS) branches. However, because
commit d5cf4d34a333 ("cgroup/cpuset: Don't track # of local child
partitions") was not backported, a corresponding adaptation to the
backported code is still required.
To ensure correct behavior, replace cgroup_is_populated with
cpuset_is_populated in the partition_is_populated function.
Cc: stable@vger.kernel.org # 6.1+
Fixes: b1bcaed1e39a ("cpuset: Treat cpusets in attaching as populated")
Cc: Waiman Long <longman@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Chen Ridong <chenridong@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/cgroup/cpuset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -385,7 +385,7 @@ static inline bool partition_is_populate
cs->attach_in_progress)
return true;
if (!excluded_child && !cs->nr_subparts)
- return cgroup_is_populated(cs->css.cgroup);
+ return cpuset_is_populated(cs);
rcu_read_lock();
cpuset_for_each_descendant_pre(cp, pos_css, cs) {
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 30/43] fbdev: rivafb: fix divide error in nv3_arb()
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 29/43] cpuset: Fix missing adaptation for cpuset_is_populated Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 31/43] fbdev: smscufx: properly copy ioctl memory to kernelspace Greg Kroah-Hartman
` (22 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Helge Deller
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
commit 0209e21e3c372fa2da04c39214bec0b64e4eb5f4 upstream.
A userspace program can trigger the RIVA NV3 arbitration code by calling
the FBIOPUT_VSCREENINFO ioctl on /dev/fb*. When doing so, the driver
recomputes FIFO arbitration parameters in nv3_arb(), using state->mclk_khz
(derived from the PRAMDAC MCLK PLL) as a divisor without validating it
first.
In a normal setup, state->mclk_khz is provided by the real hardware and is
non-zero. However, an attacker can construct a malicious or misconfigured
device (e.g. a crafted/emulated PCI device) that exposes a bogus PLL
configuration, causing state->mclk_khz to become zero. Once
nv3_get_param() calls nv3_arb(), the division by state->mclk_khz in the gns
calculation causes a divide error and crashes the kernel.
Fix this by checking whether state->mclk_khz is zero and bailing out before
doing the division.
The following log reveals it:
rivafb: setting virtual Y resolution to 2184
divide error: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 PID: 2187 Comm: syz-executor.0 Not tainted 5.18.0-rc1+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
RIP: 0010:nv3_arb drivers/video/fbdev/riva/riva_hw.c:439 [inline]
RIP: 0010:nv3_get_param+0x3ab/0x13b0 drivers/video/fbdev/riva/riva_hw.c:546
Call Trace:
nv3CalcArbitration.constprop.0+0x255/0x460 drivers/video/fbdev/riva/riva_hw.c:603
nv3UpdateArbitrationSettings drivers/video/fbdev/riva/riva_hw.c:637 [inline]
CalcStateExt+0x447/0x1b90 drivers/video/fbdev/riva/riva_hw.c:1246
riva_load_video_mode+0x8a9/0xea0 drivers/video/fbdev/riva/fbdev.c:779
rivafb_set_par+0xc0/0x5f0 drivers/video/fbdev/riva/fbdev.c:1196
fb_set_var+0x604/0xeb0 drivers/video/fbdev/core/fbmem.c:1033
do_fb_ioctl+0x234/0x670 drivers/video/fbdev/core/fbmem.c:1109
fb_ioctl+0xdd/0x130 drivers/video/fbdev/core/fbmem.c:1188
__x64_sys_ioctl+0x122/0x190 fs/ioctl.c:856
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/video/fbdev/riva/riva_hw.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -436,6 +436,9 @@ static char nv3_arb(nv3_fifo_info * res_
vmisses = 2;
eburst_size = state->memory_width * 1;
mburst_size = 32;
+ if (!state->mclk_khz)
+ return (0);
+
gns = 1000000 * (gmisses*state->mem_page_miss + state->mem_latency)/state->mclk_khz;
ainfo->by_gfacc = gns*ainfo->gdrain_rate/1000000;
ainfo->wcmocc = 0;
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 31/43] fbdev: smscufx: properly copy ioctl memory to kernelspace
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 30/43] fbdev: rivafb: fix divide error in nv3_arb() Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 32/43] f2fs: fix to add gc count stat in f2fs_gc_range Greg Kroah-Hartman
` (21 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tianchu Chen, stable,
Steve Glendinning, Helge Deller
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 120adae7b42faa641179270c067864544a50ab69 upstream.
The UFX_IOCTL_REPORT_DAMAGE ioctl does not properly copy data from
userspace to kernelspace, and instead directly references the memory,
which can cause problems if invalid data is passed from userspace. Fix
this all up by correctly copying the memory before accessing it within
the kernel.
Reported-by: Tianchu Chen <flynnnchen@tencent.com>
Cc: stable <stable@kernel.org>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/video/fbdev/smscufx.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/video/fbdev/smscufx.c
+++ b/drivers/video/fbdev/smscufx.c
@@ -932,7 +932,6 @@ static int ufx_ops_ioctl(struct fb_info
unsigned long arg)
{
struct ufx_data *dev = info->par;
- struct dloarea *area = NULL;
if (!atomic_read(&dev->usb_active))
return 0;
@@ -947,6 +946,10 @@ static int ufx_ops_ioctl(struct fb_info
/* TODO: Help propose a standard fb.h ioctl to report mmap damage */
if (cmd == UFX_IOCTL_REPORT_DAMAGE) {
+ struct dloarea *area __free(kfree) = kmalloc(sizeof(*area), GFP_KERNEL);
+ if (!area)
+ return -ENOMEM;
+
/* If we have a damage-aware client, turn fb_defio "off"
* To avoid perf imact of unnecessary page fault handling.
* Done by resetting the delay for this fb_info to a very
@@ -956,7 +959,8 @@ static int ufx_ops_ioctl(struct fb_info
if (info->fbdefio)
info->fbdefio->delay = UFX_DEFIO_WRITE_DISABLE;
- area = (struct dloarea *)arg;
+ if (copy_from_user(area, (u8 __user *)arg, sizeof(*area)))
+ return -EFAULT;
if (area->x < 0)
area->x = 0;
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 32/43] f2fs: fix to add gc count stat in f2fs_gc_range
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 31/43] fbdev: smscufx: properly copy ioctl memory to kernelspace Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 33/43] f2fs: fix to check sysfs filename w/ gc_pin_file_thresh correctly Greg Kroah-Hartman
` (20 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Zhiguo Niu, Chao Yu,
Jaegeuk Kim
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhiguo Niu <zhiguo.niu@unisoc.com>
commit 761dac9073cd67d4705a94cd1af674945a117f4c upstream.
It missed the stat count in f2fs_gc_range.
Cc: stable@kernel.org
Fixes: 9bf1dcbdfdc8 ("f2fs: fix to account gc stats correctly")
Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/gc.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -2093,6 +2093,7 @@ int f2fs_gc_range(struct f2fs_sb_info *s
if (unlikely(f2fs_cp_error(sbi)))
return -EIO;
+ stat_inc_gc_call_count(sbi, FOREGROUND);
for (segno = start_seg; segno <= end_seg; segno += SEGS_PER_SEC(sbi)) {
struct gc_inode_list gc_list = {
.ilist = LIST_HEAD_INIT(gc_list.ilist),
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 33/43] f2fs: fix to check sysfs filename w/ gc_pin_file_thresh correctly
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 32/43] f2fs: fix to add gc count stat in f2fs_gc_range Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 34/43] f2fs: fix IS_CHECKPOINTED flag inconsistency issue caused by concurrent atomic commit and checkpoint writes Greg Kroah-Hartman
` (19 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Chao Yu, Jaegeuk Kim
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <chao@kernel.org>
commit 0eda086de85e140f53c6123a4c00662f4e614ee4 upstream.
Sysfs entry name is gc_pin_file_thresh instead of gc_pin_file_threshold,
fix it.
Cc: stable@kernel.org
Fixes: c521a6ab4ad7 ("f2fs: fix to limit gc_pin_file_threshold")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -749,7 +749,7 @@ out:
return count;
}
- if (!strcmp(a->attr.name, "gc_pin_file_threshold")) {
+ if (!strcmp(a->attr.name, "gc_pin_file_thresh")) {
if (t > MAX_GC_FAILED_PINNED_FILES)
return -EINVAL;
sbi->gc_pin_file_threshold = t;
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 34/43] f2fs: fix IS_CHECKPOINTED flag inconsistency issue caused by concurrent atomic commit and checkpoint writes
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 33/43] f2fs: fix to check sysfs filename w/ gc_pin_file_thresh correctly Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 35/43] f2fs: fix out-of-bounds access in sysfs attribute read/write Greg Kroah-Hartman
` (18 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Sheng Yong, Jinbao Liu,
Yongpeng Yang, Chao Yu, Jaegeuk Kim
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yongpeng Yang <yangyongpeng@xiaomi.com>
commit 7633a7387eb4d0259d6bea945e1d3469cd135bbc upstream.
During SPO tests, when mounting F2FS, an -EINVAL error was returned from
f2fs_recover_inode_page. The issue occurred under the following scenario
Thread A Thread B
f2fs_ioc_commit_atomic_write
- f2fs_do_sync_file // atomic = true
- f2fs_fsync_node_pages
: last_folio = inode folio
: schedule before folio_lock(last_folio) f2fs_write_checkpoint
- block_operations// writeback last_folio
- schedule before f2fs_flush_nat_entries
: set_fsync_mark(last_folio, 1)
: set_dentry_mark(last_folio, 1)
: folio_mark_dirty(last_folio)
- __write_node_folio(last_folio)
: f2fs_down_read(&sbi->node_write)//block
- f2fs_flush_nat_entries
: {struct nat_entry}->flag |= BIT(IS_CHECKPOINTED)
- unblock_operations
: f2fs_up_write(&sbi->node_write)
f2fs_write_checkpoint//return
: f2fs_do_write_node_page()
f2fs_ioc_commit_atomic_write//return
SPO
Thread A calls f2fs_need_dentry_mark(sbi, ino), and the last_folio has
already been written once. However, the {struct nat_entry}->flag did not
have the IS_CHECKPOINTED set, causing set_dentry_mark(last_folio, 1) and
write last_folio again after Thread B finishes f2fs_write_checkpoint.
After SPO and reboot, it was detected that {struct node_info}->blk_addr
was not NULL_ADDR because Thread B successfully write the checkpoint.
This issue only occurs in atomic write scenarios. For regular file
fsync operations, the folio must be dirty. If
block_operations->f2fs_sync_node_pages successfully submit the folio
write, this path will not be executed. Otherwise, the
f2fs_write_checkpoint will need to wait for the folio write submission
to complete, as sbi->nr_pages[F2FS_DIRTY_NODES] > 0. Therefore, the
situation where f2fs_need_dentry_mark checks that the {struct
nat_entry}->flag /wo the IS_CHECKPOINTED flag, but the folio write has
already been submitted, will not occur.
Therefore, for atomic file fsync, sbi->node_write should be acquired
through __write_node_folio to ensure that the IS_CHECKPOINTED flag
correctly indicates that the checkpoint write has been completed.
Fixes: 608514deba38 ("f2fs: set fsync mark only for the last dnode")
Cc: stable@kernel.org
Signed-off-by: Sheng Yong <shengyong1@xiaomi.com>
Signed-off-by: Jinbao Liu <liujinbao1@xiaomi.com>
Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/node.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1774,8 +1774,13 @@ static bool __write_node_folio(struct fo
goto redirty_out;
}
- if (atomic && !test_opt(sbi, NOBARRIER))
- fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
+ if (atomic) {
+ if (!test_opt(sbi, NOBARRIER))
+ fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
+ if (IS_INODE(folio))
+ set_dentry_mark(folio,
+ f2fs_need_dentry_mark(sbi, ino_of_node(folio)));
+ }
/* should add to global list before clearing PAGECACHE status */
if (f2fs_in_warm_node_list(sbi, folio)) {
@@ -1916,8 +1921,9 @@ continue_unlock:
if (is_inode_flag_set(inode,
FI_DIRTY_INODE))
f2fs_update_inode(inode, folio);
- set_dentry_mark(folio,
- f2fs_need_dentry_mark(sbi, ino));
+ if (!atomic)
+ set_dentry_mark(folio,
+ f2fs_need_dentry_mark(sbi, ino));
}
/* may be written by other thread */
if (!folio_test_dirty(folio))
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 35/43] f2fs: fix out-of-bounds access in sysfs attribute read/write
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 34/43] f2fs: fix IS_CHECKPOINTED flag inconsistency issue caused by concurrent atomic commit and checkpoint writes Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 36/43] f2fs: fix to avoid UAF in f2fs_write_end_io() Greg Kroah-Hartman
` (17 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jinbao Liu, Yongpeng Yang,
Chao Yu, Jaegeuk Kim
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yongpeng Yang <yangyongpeng@xiaomi.com>
commit 98ea0039dbfdd00e5cc1b9a8afa40434476c0955 upstream.
Some f2fs sysfs attributes suffer from out-of-bounds memory access and
incorrect handling of integer values whose size is not 4 bytes.
For example:
vm:~# echo 65537 > /sys/fs/f2fs/vde/carve_out
vm:~# cat /sys/fs/f2fs/vde/carve_out
65537
vm:~# echo 4294967297 > /sys/fs/f2fs/vde/atgc_age_threshold
vm:~# cat /sys/fs/f2fs/vde/atgc_age_threshold
1
carve_out maps to {struct f2fs_sb_info}->carve_out, which is a 8-bit
integer. However, the sysfs interface allows setting it to a value
larger than 255, resulting in an out-of-range update.
atgc_age_threshold maps to {struct atgc_management}->age_threshold,
which is a 64-bit integer, but its sysfs interface cannot correctly set
values larger than UINT_MAX.
The root causes are:
1. __sbi_store() treats all default values as unsigned int, which
prevents updating integers larger than 4 bytes and causes out-of-bounds
writes for integers smaller than 4 bytes.
2. f2fs_sbi_show() also assumes all default values are unsigned int,
leading to out-of-bounds reads and incorrect access to integers larger
than 4 bytes.
This patch introduces {struct f2fs_attr}->size to record the actual size
of the integer associated with each sysfs attribute. With this
information, sysfs read and write operations can correctly access and
update values according to their real data size, avoiding memory
corruption and truncation.
Fixes: b59d0bae6ca3 ("f2fs: add sysfs support for controlling the gc_thread")
Cc: stable@kernel.org
Signed-off-by: Jinbao Liu <liujinbao1@xiaomi.com>
Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/sysfs.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 52 insertions(+), 8 deletions(-)
--- a/fs/f2fs/sysfs.c
+++ b/fs/f2fs/sysfs.c
@@ -58,6 +58,7 @@ struct f2fs_attr {
const char *buf, size_t len);
int struct_type;
int offset;
+ int size;
int id;
};
@@ -344,11 +345,30 @@ static ssize_t main_blkaddr_show(struct
(unsigned long long)MAIN_BLKADDR(sbi));
}
+static ssize_t __sbi_show_value(struct f2fs_attr *a,
+ struct f2fs_sb_info *sbi, char *buf,
+ unsigned char *value)
+{
+ switch (a->size) {
+ case 1:
+ return sysfs_emit(buf, "%u\n", *(u8 *)value);
+ case 2:
+ return sysfs_emit(buf, "%u\n", *(u16 *)value);
+ case 4:
+ return sysfs_emit(buf, "%u\n", *(u32 *)value);
+ case 8:
+ return sysfs_emit(buf, "%llu\n", *(u64 *)value);
+ default:
+ f2fs_bug_on(sbi, 1);
+ return sysfs_emit(buf,
+ "show sysfs node value with wrong type\n");
+ }
+}
+
static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
struct f2fs_sb_info *sbi, char *buf)
{
unsigned char *ptr = NULL;
- unsigned int *ui;
ptr = __struct_ptr(sbi, a->struct_type);
if (!ptr)
@@ -428,9 +448,30 @@ static ssize_t f2fs_sbi_show(struct f2fs
atomic_read(&sbi->cp_call_count[BACKGROUND]));
#endif
- ui = (unsigned int *)(ptr + a->offset);
+ return __sbi_show_value(a, sbi, buf, ptr + a->offset);
+}
- return sysfs_emit(buf, "%u\n", *ui);
+static void __sbi_store_value(struct f2fs_attr *a,
+ struct f2fs_sb_info *sbi,
+ unsigned char *ui, unsigned long value)
+{
+ switch (a->size) {
+ case 1:
+ *(u8 *)ui = value;
+ break;
+ case 2:
+ *(u16 *)ui = value;
+ break;
+ case 4:
+ *(u32 *)ui = value;
+ break;
+ case 8:
+ *(u64 *)ui = value;
+ break;
+ default:
+ f2fs_bug_on(sbi, 1);
+ f2fs_err(sbi, "store sysfs node value with wrong type");
+ }
}
static ssize_t __sbi_store(struct f2fs_attr *a,
@@ -906,7 +947,7 @@ out:
return count;
}
- *ui = (unsigned int)t;
+ __sbi_store_value(a, sbi, ptr + a->offset, t);
return count;
}
@@ -1053,24 +1094,27 @@ static struct f2fs_attr f2fs_attr_sb_##_
.id = F2FS_FEATURE_##_feat, \
}
-#define F2FS_ATTR_OFFSET(_struct_type, _name, _mode, _show, _store, _offset) \
+#define F2FS_ATTR_OFFSET(_struct_type, _name, _mode, _show, _store, _offset, _size) \
static struct f2fs_attr f2fs_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.store = _store, \
.struct_type = _struct_type, \
- .offset = _offset \
+ .offset = _offset, \
+ .size = _size \
}
#define F2FS_RO_ATTR(struct_type, struct_name, name, elname) \
F2FS_ATTR_OFFSET(struct_type, name, 0444, \
f2fs_sbi_show, NULL, \
- offsetof(struct struct_name, elname))
+ offsetof(struct struct_name, elname), \
+ sizeof_field(struct struct_name, elname))
#define F2FS_RW_ATTR(struct_type, struct_name, name, elname) \
F2FS_ATTR_OFFSET(struct_type, name, 0644, \
f2fs_sbi_show, f2fs_sbi_store, \
- offsetof(struct struct_name, elname))
+ offsetof(struct struct_name, elname), \
+ sizeof_field(struct struct_name, elname))
#define F2FS_GENERAL_RO_ATTR(name) \
static struct f2fs_attr f2fs_attr_##name = __ATTR(name, 0444, name##_show, NULL)
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 36/43] f2fs: fix to avoid UAF in f2fs_write_end_io()
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 35/43] f2fs: fix out-of-bounds access in sysfs attribute read/write Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 37/43] f2fs: support non-4KB block size without packed_ssa feature Greg Kroah-Hartman
` (16 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, syzbot+b4444e3c972a7a124187,
Chao Yu, Jaegeuk Kim
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <chao@kernel.org>
commit ce2739e482bce8d2c014d76c4531c877f382aa54 upstream.
As syzbot reported an use-after-free issue in f2fs_write_end_io().
It is caused by below race condition:
loop device umount
- worker_thread
- loop_process_work
- do_req_filebacked
- lo_rw_aio
- lo_rw_aio_complete
- blk_mq_end_request
- blk_update_request
- f2fs_write_end_io
- dec_page_count
- folio_end_writeback
- kill_f2fs_super
- kill_block_super
- f2fs_put_super
: free(sbi)
: get_pages(, F2FS_WB_CP_DATA)
accessed sbi which is freed
In kill_f2fs_super(), we will drop all page caches of f2fs inodes before
call free(sbi), it guarantee that all folios should end its writeback, so
it should be safe to access sbi before last folio_end_writeback().
Let's relocate ckpt thread wakeup flow before folio_end_writeback() to
resolve this issue.
Cc: stable@kernel.org
Fixes: e234088758fc ("f2fs: avoid wait if IO end up when do_checkpoint for better performance")
Reported-by: syzbot+b4444e3c972a7a124187@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=b4444e3c972a7a124187
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/data.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -356,14 +356,20 @@ static void f2fs_write_end_io(struct bio
folio->index != nid_of_node(folio));
dec_page_count(sbi, type);
+
+ /*
+ * we should access sbi before folio_end_writeback() to
+ * avoid racing w/ kill_f2fs_super()
+ */
+ if (type == F2FS_WB_CP_DATA && !get_pages(sbi, type) &&
+ wq_has_sleeper(&sbi->cp_wait))
+ wake_up(&sbi->cp_wait);
+
if (f2fs_in_warm_node_list(sbi, folio))
f2fs_del_fsync_node_entry(sbi, folio);
folio_clear_f2fs_gcing(folio);
folio_end_writeback(folio);
}
- if (!get_pages(sbi, F2FS_WB_CP_DATA) &&
- wq_has_sleeper(&sbi->cp_wait))
- wake_up(&sbi->cp_wait);
bio_put(bio);
}
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 37/43] f2fs: support non-4KB block size without packed_ssa feature
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 36/43] f2fs: fix to avoid UAF in f2fs_write_end_io() Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 38/43] f2fs: fix to avoid mapping wrong physical block for swapfile Greg Kroah-Hartman
` (15 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Daeho Jeong, Chao Yu,
Jaegeuk Kim
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daeho Jeong <daehojeong@google.com>
commit e48e16f3e37fac76e2f0c14c58df2b0398a323b0 upstream.
Currently, F2FS requires the packed_ssa feature to be enabled when
utilizing non-4KB block sizes (e.g., 16KB). This restriction limits
the flexibility of filesystem formatting options.
This patch allows F2FS to support non-4KB block sizes even when the
packed_ssa feature is disabled. It adjusts the SSA calculation logic to
correctly handle summary entries in larger blocks without the packed
layout.
Cc: stable@kernel.org
Fixes: 7ee8bc3942f2 ("f2fs: revert summary entry count from 2048 to 512 in 16kb block support")
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/f2fs.h | 52 ++++++++++++++++++++---------
fs/f2fs/gc.c | 23 ++++++------
fs/f2fs/node.c | 12 +++---
fs/f2fs/recovery.c | 6 +--
fs/f2fs/segment.c | 86 +++++++++++++++++++++++++-----------------------
fs/f2fs/segment.h | 9 ++---
fs/f2fs/super.c | 26 ++++++--------
include/linux/f2fs_fs.h | 73 +++++++++++++++++++++++++---------------
8 files changed, 165 insertions(+), 122 deletions(-)
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -508,13 +508,25 @@ struct fsync_inode_entry {
#define nats_in_cursum(jnl) (le16_to_cpu((jnl)->n_nats))
#define sits_in_cursum(jnl) (le16_to_cpu((jnl)->n_sits))
-#define nat_in_journal(jnl, i) ((jnl)->nat_j.entries[i].ne)
-#define nid_in_journal(jnl, i) ((jnl)->nat_j.entries[i].nid)
-#define sit_in_journal(jnl, i) ((jnl)->sit_j.entries[i].se)
-#define segno_in_journal(jnl, i) ((jnl)->sit_j.entries[i].segno)
+#define nat_in_journal(jnl, i) \
+ (((struct nat_journal_entry *)(jnl)->nat_j.entries)[i].ne)
+#define nid_in_journal(jnl, i) \
+ (((struct nat_journal_entry *)(jnl)->nat_j.entries)[i].nid)
+#define sit_in_journal(jnl, i) \
+ (((struct sit_journal_entry *)(jnl)->sit_j.entries)[i].se)
+#define segno_in_journal(jnl, i) \
+ (((struct sit_journal_entry *)(jnl)->sit_j.entries)[i].segno)
+
+#define sum_entries(sum) ((struct f2fs_summary *)(sum))
+#define sum_journal(sbi, sum) \
+ ((struct f2fs_journal *)((char *)(sum) + \
+ ((sbi)->entries_in_sum * sizeof(struct f2fs_summary))))
+#define sum_footer(sbi, sum) \
+ ((struct summary_footer *)((char *)(sum) + (sbi)->sum_blocksize - \
+ sizeof(struct summary_footer)))
-#define MAX_NAT_JENTRIES(jnl) (NAT_JOURNAL_ENTRIES - nats_in_cursum(jnl))
-#define MAX_SIT_JENTRIES(jnl) (SIT_JOURNAL_ENTRIES - sits_in_cursum(jnl))
+#define MAX_NAT_JENTRIES(sbi, jnl) ((sbi)->nat_journal_entries - nats_in_cursum(jnl))
+#define MAX_SIT_JENTRIES(sbi, jnl) ((sbi)->sit_journal_entries - sits_in_cursum(jnl))
static inline int update_nats_in_cursum(struct f2fs_journal *journal, int i)
{
@@ -532,14 +544,6 @@ static inline int update_sits_in_cursum(
return before;
}
-static inline bool __has_cursum_space(struct f2fs_journal *journal,
- int size, int type)
-{
- if (type == NAT_JOURNAL)
- return size <= MAX_NAT_JENTRIES(journal);
- return size <= MAX_SIT_JENTRIES(journal);
-}
-
/* for inline stuff */
#define DEF_INLINE_RESERVED_SIZE 1
static inline int get_extra_isize(struct inode *inode);
@@ -1750,6 +1754,15 @@ struct f2fs_sb_info {
bool readdir_ra; /* readahead inode in readdir */
u64 max_io_bytes; /* max io bytes to merge IOs */
+ /* variable summary block units */
+ unsigned int sum_blocksize; /* sum block size */
+ unsigned int sums_per_block; /* sum block count per block */
+ unsigned int entries_in_sum; /* entry count in sum block */
+ unsigned int sum_entry_size; /* total entry size in sum block */
+ unsigned int sum_journal_size; /* journal size in sum block */
+ unsigned int nat_journal_entries; /* nat journal entry count in the journal */
+ unsigned int sit_journal_entries; /* sit journal entry count in the journal */
+
block_t user_block_count; /* # of user blocks */
block_t total_valid_block_count; /* # of valid blocks */
block_t discard_blks; /* discard command candidats */
@@ -2799,6 +2812,14 @@ static inline block_t __start_sum_addr(s
return le32_to_cpu(F2FS_CKPT(sbi)->cp_pack_start_sum);
}
+static inline bool __has_cursum_space(struct f2fs_sb_info *sbi,
+ struct f2fs_journal *journal, int size, int type)
+{
+ if (type == NAT_JOURNAL)
+ return size <= MAX_NAT_JENTRIES(sbi, journal);
+ return size <= MAX_SIT_JENTRIES(sbi, journal);
+}
+
extern void f2fs_mark_inode_dirty_sync(struct inode *inode, bool sync);
static inline int inc_valid_node_count(struct f2fs_sb_info *sbi,
struct inode *inode, bool is_inode)
@@ -3952,7 +3973,8 @@ void f2fs_wait_on_block_writeback_range(
block_t len);
void f2fs_write_data_summaries(struct f2fs_sb_info *sbi, block_t start_blk);
void f2fs_write_node_summaries(struct f2fs_sb_info *sbi, block_t start_blk);
-int f2fs_lookup_journal_in_cursum(struct f2fs_journal *journal, int type,
+int f2fs_lookup_journal_in_cursum(struct f2fs_sb_info *sbi,
+ struct f2fs_journal *journal, int type,
unsigned int val, int alloc);
void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc);
int f2fs_check_and_fix_write_pointer(struct f2fs_sb_info *sbi);
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1766,8 +1766,8 @@ static int do_garbage_collect(struct f2f
sanity_check_seg_type(sbi, get_seg_entry(sbi, segno)->type);
- segno = rounddown(segno, SUMS_PER_BLOCK);
- sum_blk_cnt = DIV_ROUND_UP(end_segno - segno, SUMS_PER_BLOCK);
+ segno = rounddown(segno, sbi->sums_per_block);
+ sum_blk_cnt = DIV_ROUND_UP(end_segno - segno, sbi->sums_per_block);
/* readahead multi ssa blocks those have contiguous address */
if (__is_large_section(sbi))
f2fs_ra_meta_pages(sbi, GET_SUM_BLOCK(sbi, segno),
@@ -1777,17 +1777,17 @@ static int do_garbage_collect(struct f2f
while (segno < end_segno) {
struct folio *sum_folio = f2fs_get_sum_folio(sbi, segno);
- segno += SUMS_PER_BLOCK;
+ segno += sbi->sums_per_block;
if (IS_ERR(sum_folio)) {
int err = PTR_ERR(sum_folio);
- end_segno = segno - SUMS_PER_BLOCK;
- segno = rounddown(start_segno, SUMS_PER_BLOCK);
+ end_segno = segno - sbi->sums_per_block;
+ segno = rounddown(start_segno, sbi->sums_per_block);
while (segno < end_segno) {
sum_folio = filemap_get_folio(META_MAPPING(sbi),
GET_SUM_BLOCK(sbi, segno));
folio_put_refs(sum_folio, 2);
- segno += SUMS_PER_BLOCK;
+ segno += sbi->sums_per_block;
}
return err;
}
@@ -1803,8 +1803,8 @@ static int do_garbage_collect(struct f2f
/* find segment summary of victim */
struct folio *sum_folio = filemap_get_folio(META_MAPPING(sbi),
GET_SUM_BLOCK(sbi, segno));
- unsigned int block_end_segno = rounddown(segno, SUMS_PER_BLOCK)
- + SUMS_PER_BLOCK;
+ unsigned int block_end_segno = rounddown(segno, sbi->sums_per_block)
+ + sbi->sums_per_block;
if (block_end_segno > end_segno)
block_end_segno = end_segno;
@@ -1830,12 +1830,13 @@ static int do_garbage_collect(struct f2f
migrated >= sbi->migration_granularity)
continue;
- sum = SUM_BLK_PAGE_ADDR(sum_folio, cur_segno);
- if (type != GET_SUM_TYPE((&sum->footer))) {
+ sum = SUM_BLK_PAGE_ADDR(sbi, sum_folio, cur_segno);
+ if (type != GET_SUM_TYPE(sum_footer(sbi, sum))) {
f2fs_err(sbi, "Inconsistent segment (%u) type "
"[%d, %d] in SSA and SIT",
cur_segno, type,
- GET_SUM_TYPE((&sum->footer)));
+ GET_SUM_TYPE(
+ sum_footer(sbi, sum)));
f2fs_stop_checkpoint(sbi, false,
STOP_CP_REASON_CORRUPTED_SUMMARY);
continue;
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -606,7 +606,7 @@ retry:
goto retry;
}
- i = f2fs_lookup_journal_in_cursum(journal, NAT_JOURNAL, nid, 0);
+ i = f2fs_lookup_journal_in_cursum(sbi, journal, NAT_JOURNAL, nid, 0);
if (i >= 0) {
ne = nat_in_journal(journal, i);
node_info_from_raw_nat(ni, &ne);
@@ -2943,7 +2943,7 @@ int f2fs_restore_node_summary(struct f2f
/* scan the node segment */
last_offset = BLKS_PER_SEG(sbi);
addr = START_BLOCK(sbi, segno);
- sum_entry = &sum->entries[0];
+ sum_entry = sum_entries(sum);
for (i = 0; i < last_offset; i += nrpages, addr += nrpages) {
nrpages = bio_max_segs(last_offset - i);
@@ -3084,7 +3084,7 @@ static int __flush_nat_entry_set(struct
* #2, flush nat entries to nat page.
*/
if (enabled_nat_bits(sbi, cpc) ||
- !__has_cursum_space(journal, set->entry_cnt, NAT_JOURNAL))
+ !__has_cursum_space(sbi, journal, set->entry_cnt, NAT_JOURNAL))
to_journal = false;
if (to_journal) {
@@ -3107,7 +3107,7 @@ static int __flush_nat_entry_set(struct
f2fs_bug_on(sbi, nat_get_blkaddr(ne) == NEW_ADDR);
if (to_journal) {
- offset = f2fs_lookup_journal_in_cursum(journal,
+ offset = f2fs_lookup_journal_in_cursum(sbi, journal,
NAT_JOURNAL, nid, 1);
f2fs_bug_on(sbi, offset < 0);
raw_ne = &nat_in_journal(journal, offset);
@@ -3178,7 +3178,7 @@ int f2fs_flush_nat_entries(struct f2fs_s
* into nat entry set.
*/
if (enabled_nat_bits(sbi, cpc) ||
- !__has_cursum_space(journal,
+ !__has_cursum_space(sbi, journal,
nm_i->nat_cnt[DIRTY_NAT], NAT_JOURNAL))
remove_nats_in_journal(sbi);
@@ -3189,7 +3189,7 @@ int f2fs_flush_nat_entries(struct f2fs_s
set_idx = setvec[found - 1]->set + 1;
for (idx = 0; idx < found; idx++)
__adjust_nat_entry_set(setvec[idx], &sets,
- MAX_NAT_JENTRIES(journal));
+ MAX_NAT_JENTRIES(sbi, journal));
}
/* flush dirty nats in nat entry set */
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -514,7 +514,7 @@ static int check_index_in_prev_nodes(str
struct curseg_info *curseg = CURSEG_I(sbi, i);
if (curseg->segno == segno) {
- sum = curseg->sum_blk->entries[blkoff];
+ sum = sum_entries(curseg->sum_blk)[blkoff];
goto got_it;
}
}
@@ -522,8 +522,8 @@ static int check_index_in_prev_nodes(str
sum_folio = f2fs_get_sum_folio(sbi, segno);
if (IS_ERR(sum_folio))
return PTR_ERR(sum_folio);
- sum_node = SUM_BLK_PAGE_ADDR(sum_folio, segno);
- sum = sum_node->entries[blkoff];
+ sum_node = SUM_BLK_PAGE_ADDR(sbi, sum_folio, segno);
+ sum = sum_entries(sum_node)[blkoff];
f2fs_folio_put(sum_folio, true);
got_it:
/* Use the locked dnode page and inode */
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2689,12 +2689,12 @@ int f2fs_npages_for_summary_flush(struct
valid_sum_count += f2fs_curseg_valid_blocks(sbi, i);
}
- sum_in_page = (PAGE_SIZE - 2 * SUM_JOURNAL_SIZE -
+ sum_in_page = (sbi->sum_blocksize - 2 * sbi->sum_journal_size -
SUM_FOOTER_SIZE) / SUMMARY_SIZE;
if (valid_sum_count <= sum_in_page)
return 1;
else if ((valid_sum_count - sum_in_page) <=
- (PAGE_SIZE - SUM_FOOTER_SIZE) / SUMMARY_SIZE)
+ (sbi->sum_blocksize - SUM_FOOTER_SIZE) / SUMMARY_SIZE)
return 2;
return 3;
}
@@ -2714,7 +2714,7 @@ void f2fs_update_meta_page(struct f2fs_s
{
struct folio *folio;
- if (SUMS_PER_BLOCK == 1)
+ if (!f2fs_sb_has_packed_ssa(sbi))
folio = f2fs_grab_meta_folio(sbi, blk_addr);
else
folio = f2fs_get_meta_folio_retry(sbi, blk_addr);
@@ -2732,7 +2732,7 @@ static void write_sum_page(struct f2fs_s
{
struct folio *folio;
- if (SUMS_PER_BLOCK == 1)
+ if (!f2fs_sb_has_packed_ssa(sbi))
return f2fs_update_meta_page(sbi, (void *)sum_blk,
GET_SUM_BLOCK(sbi, segno));
@@ -2740,7 +2740,8 @@ static void write_sum_page(struct f2fs_s
if (IS_ERR(folio))
return;
- memcpy(SUM_BLK_PAGE_ADDR(folio, segno), sum_blk, sizeof(*sum_blk));
+ memcpy(SUM_BLK_PAGE_ADDR(sbi, folio, segno), sum_blk,
+ sbi->sum_blocksize);
folio_mark_dirty(folio);
f2fs_folio_put(folio, true);
}
@@ -2759,11 +2760,11 @@ static void write_current_sum_page(struc
mutex_lock(&curseg->curseg_mutex);
down_read(&curseg->journal_rwsem);
- memcpy(&dst->journal, curseg->journal, SUM_JOURNAL_SIZE);
+ memcpy(sum_journal(sbi, dst), curseg->journal, sbi->sum_journal_size);
up_read(&curseg->journal_rwsem);
- memcpy(dst->entries, src->entries, SUM_ENTRY_SIZE);
- memcpy(&dst->footer, &src->footer, SUM_FOOTER_SIZE);
+ memcpy(sum_entries(dst), sum_entries(src), sbi->sum_entry_size);
+ memcpy(sum_footer(sbi, dst), sum_footer(sbi, src), SUM_FOOTER_SIZE);
mutex_unlock(&curseg->curseg_mutex);
@@ -2936,7 +2937,7 @@ static void reset_curseg(struct f2fs_sb_
curseg->next_blkoff = 0;
curseg->next_segno = NULL_SEGNO;
- sum_footer = &(curseg->sum_blk->footer);
+ sum_footer = sum_footer(sbi, curseg->sum_blk);
memset(sum_footer, 0, sizeof(struct summary_footer));
sanity_check_seg_type(sbi, seg_type);
@@ -3082,11 +3083,11 @@ static int change_curseg(struct f2fs_sb_
sum_folio = f2fs_get_sum_folio(sbi, new_segno);
if (IS_ERR(sum_folio)) {
/* GC won't be able to use stale summary pages by cp_error */
- memset(curseg->sum_blk, 0, SUM_ENTRY_SIZE);
+ memset(curseg->sum_blk, 0, sbi->sum_entry_size);
return PTR_ERR(sum_folio);
}
- sum_node = SUM_BLK_PAGE_ADDR(sum_folio, new_segno);
- memcpy(curseg->sum_blk, sum_node, SUM_ENTRY_SIZE);
+ sum_node = SUM_BLK_PAGE_ADDR(sbi, sum_folio, new_segno);
+ memcpy(curseg->sum_blk, sum_node, sbi->sum_entry_size);
f2fs_folio_put(sum_folio, true);
return 0;
}
@@ -3818,7 +3819,7 @@ int f2fs_allocate_data_block(struct f2fs
f2fs_wait_discard_bio(sbi, *new_blkaddr);
- curseg->sum_blk->entries[curseg->next_blkoff] = *sum;
+ sum_entries(curseg->sum_blk)[curseg->next_blkoff] = *sum;
if (curseg->alloc_type == SSR) {
curseg->next_blkoff = f2fs_find_next_ssr_block(sbi, curseg);
} else {
@@ -4187,7 +4188,7 @@ void f2fs_do_replace_block(struct f2fs_s
}
curseg->next_blkoff = GET_BLKOFF_FROM_SEG0(sbi, new_blkaddr);
- curseg->sum_blk->entries[curseg->next_blkoff] = *sum;
+ sum_entries(curseg->sum_blk)[curseg->next_blkoff] = *sum;
if (!recover_curseg || recover_newaddr) {
if (!from_gc)
@@ -4307,12 +4308,12 @@ static int read_compacted_summaries(stru
/* Step 1: restore nat cache */
seg_i = CURSEG_I(sbi, CURSEG_HOT_DATA);
- memcpy(seg_i->journal, kaddr, SUM_JOURNAL_SIZE);
+ memcpy(seg_i->journal, kaddr, sbi->sum_journal_size);
/* Step 2: restore sit cache */
seg_i = CURSEG_I(sbi, CURSEG_COLD_DATA);
- memcpy(seg_i->journal, kaddr + SUM_JOURNAL_SIZE, SUM_JOURNAL_SIZE);
- offset = 2 * SUM_JOURNAL_SIZE;
+ memcpy(seg_i->journal, kaddr + sbi->sum_journal_size, sbi->sum_journal_size);
+ offset = 2 * sbi->sum_journal_size;
/* Step 3: restore summary entries */
for (i = CURSEG_HOT_DATA; i <= CURSEG_COLD_DATA; i++) {
@@ -4334,9 +4335,9 @@ static int read_compacted_summaries(stru
struct f2fs_summary *s;
s = (struct f2fs_summary *)(kaddr + offset);
- seg_i->sum_blk->entries[j] = *s;
+ sum_entries(seg_i->sum_blk)[j] = *s;
offset += SUMMARY_SIZE;
- if (offset + SUMMARY_SIZE <= PAGE_SIZE -
+ if (offset + SUMMARY_SIZE <= sbi->sum_blocksize -
SUM_FOOTER_SIZE)
continue;
@@ -4392,7 +4393,7 @@ static int read_normal_summaries(struct
if (IS_NODESEG(type)) {
if (__exist_node_summaries(sbi)) {
- struct f2fs_summary *ns = &sum->entries[0];
+ struct f2fs_summary *ns = sum_entries(sum);
int i;
for (i = 0; i < BLKS_PER_SEG(sbi); i++, ns++) {
@@ -4412,11 +4413,13 @@ static int read_normal_summaries(struct
/* update journal info */
down_write(&curseg->journal_rwsem);
- memcpy(curseg->journal, &sum->journal, SUM_JOURNAL_SIZE);
+ memcpy(curseg->journal, sum_journal(sbi, sum), sbi->sum_journal_size);
up_write(&curseg->journal_rwsem);
- memcpy(curseg->sum_blk->entries, sum->entries, SUM_ENTRY_SIZE);
- memcpy(&curseg->sum_blk->footer, &sum->footer, SUM_FOOTER_SIZE);
+ memcpy(sum_entries(curseg->sum_blk), sum_entries(sum),
+ sbi->sum_entry_size);
+ memcpy(sum_footer(sbi, curseg->sum_blk), sum_footer(sbi, sum),
+ SUM_FOOTER_SIZE);
curseg->next_segno = segno;
reset_curseg(sbi, type, 0);
curseg->alloc_type = ckpt->alloc_type[type];
@@ -4460,8 +4463,8 @@ static int restore_curseg_summaries(stru
}
/* sanity check for summary blocks */
- if (nats_in_cursum(nat_j) > NAT_JOURNAL_ENTRIES ||
- sits_in_cursum(sit_j) > SIT_JOURNAL_ENTRIES) {
+ if (nats_in_cursum(nat_j) > sbi->nat_journal_entries ||
+ sits_in_cursum(sit_j) > sbi->sit_journal_entries) {
f2fs_err(sbi, "invalid journal entries nats %u sits %u",
nats_in_cursum(nat_j), sits_in_cursum(sit_j));
return -EINVAL;
@@ -4485,13 +4488,13 @@ static void write_compacted_summaries(st
/* Step 1: write nat cache */
seg_i = CURSEG_I(sbi, CURSEG_HOT_DATA);
- memcpy(kaddr, seg_i->journal, SUM_JOURNAL_SIZE);
- written_size += SUM_JOURNAL_SIZE;
+ memcpy(kaddr, seg_i->journal, sbi->sum_journal_size);
+ written_size += sbi->sum_journal_size;
/* Step 2: write sit cache */
seg_i = CURSEG_I(sbi, CURSEG_COLD_DATA);
- memcpy(kaddr + written_size, seg_i->journal, SUM_JOURNAL_SIZE);
- written_size += SUM_JOURNAL_SIZE;
+ memcpy(kaddr + written_size, seg_i->journal, sbi->sum_journal_size);
+ written_size += sbi->sum_journal_size;
/* Step 3: write summary entries */
for (i = CURSEG_HOT_DATA; i <= CURSEG_COLD_DATA; i++) {
@@ -4504,7 +4507,7 @@ static void write_compacted_summaries(st
written_size = 0;
}
summary = (struct f2fs_summary *)(kaddr + written_size);
- *summary = seg_i->sum_blk->entries[j];
+ *summary = sum_entries(seg_i->sum_blk)[j];
written_size += SUMMARY_SIZE;
if (written_size + SUMMARY_SIZE <= PAGE_SIZE -
@@ -4549,8 +4552,9 @@ void f2fs_write_node_summaries(struct f2
write_normal_summaries(sbi, start_blk, CURSEG_HOT_NODE);
}
-int f2fs_lookup_journal_in_cursum(struct f2fs_journal *journal, int type,
- unsigned int val, int alloc)
+int f2fs_lookup_journal_in_cursum(struct f2fs_sb_info *sbi,
+ struct f2fs_journal *journal, int type,
+ unsigned int val, int alloc)
{
int i;
@@ -4559,13 +4563,13 @@ int f2fs_lookup_journal_in_cursum(struct
if (le32_to_cpu(nid_in_journal(journal, i)) == val)
return i;
}
- if (alloc && __has_cursum_space(journal, 1, NAT_JOURNAL))
+ if (alloc && __has_cursum_space(sbi, journal, 1, NAT_JOURNAL))
return update_nats_in_cursum(journal, 1);
} else if (type == SIT_JOURNAL) {
for (i = 0; i < sits_in_cursum(journal); i++)
if (le32_to_cpu(segno_in_journal(journal, i)) == val)
return i;
- if (alloc && __has_cursum_space(journal, 1, SIT_JOURNAL))
+ if (alloc && __has_cursum_space(sbi, journal, 1, SIT_JOURNAL))
return update_sits_in_cursum(journal, 1);
}
return -1;
@@ -4713,8 +4717,8 @@ void f2fs_flush_sit_entries(struct f2fs_
* entries, remove all entries from journal and add and account
* them in sit entry set.
*/
- if (!__has_cursum_space(journal, sit_i->dirty_sentries, SIT_JOURNAL) ||
- !to_journal)
+ if (!__has_cursum_space(sbi, journal,
+ sit_i->dirty_sentries, SIT_JOURNAL) || !to_journal)
remove_sits_in_journal(sbi);
/*
@@ -4731,7 +4735,8 @@ void f2fs_flush_sit_entries(struct f2fs_
unsigned int segno = start_segno;
if (to_journal &&
- !__has_cursum_space(journal, ses->entry_cnt, SIT_JOURNAL))
+ !__has_cursum_space(sbi, journal, ses->entry_cnt,
+ SIT_JOURNAL))
to_journal = false;
if (to_journal) {
@@ -4759,7 +4764,7 @@ void f2fs_flush_sit_entries(struct f2fs_
}
if (to_journal) {
- offset = f2fs_lookup_journal_in_cursum(journal,
+ offset = f2fs_lookup_journal_in_cursum(sbi, journal,
SIT_JOURNAL, segno, 1);
f2fs_bug_on(sbi, offset < 0);
segno_in_journal(journal, offset) =
@@ -4966,12 +4971,13 @@ static int build_curseg(struct f2fs_sb_i
for (i = 0; i < NO_CHECK_TYPE; i++) {
mutex_init(&array[i].curseg_mutex);
- array[i].sum_blk = f2fs_kzalloc(sbi, PAGE_SIZE, GFP_KERNEL);
+ array[i].sum_blk = f2fs_kzalloc(sbi, sbi->sum_blocksize,
+ GFP_KERNEL);
if (!array[i].sum_blk)
return -ENOMEM;
init_rwsem(&array[i].journal_rwsem);
array[i].journal = f2fs_kzalloc(sbi,
- sizeof(struct f2fs_journal), GFP_KERNEL);
+ sbi->sum_journal_size, GFP_KERNEL);
if (!array[i].journal)
return -ENOMEM;
array[i].seg_type = log_type_to_seg_type(i);
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -85,12 +85,11 @@ static inline void sanity_check_seg_type
#define GET_ZONE_FROM_SEG(sbi, segno) \
GET_ZONE_FROM_SEC(sbi, GET_SEC_FROM_SEG(sbi, segno))
-#define SUMS_PER_BLOCK (F2FS_BLKSIZE / F2FS_SUM_BLKSIZE)
#define GET_SUM_BLOCK(sbi, segno) \
- (SM_I(sbi)->ssa_blkaddr + (segno / SUMS_PER_BLOCK))
-#define GET_SUM_BLKOFF(segno) (segno % SUMS_PER_BLOCK)
-#define SUM_BLK_PAGE_ADDR(folio, segno) \
- (folio_address(folio) + GET_SUM_BLKOFF(segno) * F2FS_SUM_BLKSIZE)
+ (SM_I(sbi)->ssa_blkaddr + (segno / (sbi)->sums_per_block))
+#define GET_SUM_BLKOFF(sbi, segno) (segno % (sbi)->sums_per_block)
+#define SUM_BLK_PAGE_ADDR(sbi, folio, segno) \
+ (folio_address(folio) + GET_SUM_BLKOFF(sbi, segno) * (sbi)->sum_blocksize)
#define GET_SUM_TYPE(footer) ((footer)->entry_type)
#define SET_SUM_TYPE(footer, type) ((footer)->entry_type = (type))
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -4059,20 +4059,6 @@ static int sanity_check_raw_super(struct
if (sanity_check_area_boundary(sbi, folio, index))
return -EFSCORRUPTED;
- /*
- * Check for legacy summary layout on 16KB+ block devices.
- * Modern f2fs-tools packs multiple 4KB summary areas into one block,
- * whereas legacy versions used one block per summary, leading
- * to a much larger SSA.
- */
- if (SUMS_PER_BLOCK > 1 &&
- !(__F2FS_HAS_FEATURE(raw_super, F2FS_FEATURE_PACKED_SSA))) {
- f2fs_info(sbi, "Error: Device formatted with a legacy version. "
- "Please reformat with a tool supporting the packed ssa "
- "feature for block sizes larger than 4kb.");
- return -EOPNOTSUPP;
- }
-
return 0;
}
@@ -4283,6 +4269,18 @@ static void init_sb_info(struct f2fs_sb_
spin_lock_init(&sbi->gc_remaining_trials_lock);
atomic64_set(&sbi->current_atomic_write, 0);
+ sbi->sum_blocksize = f2fs_sb_has_packed_ssa(sbi) ?
+ 4096 : sbi->blocksize;
+ sbi->sums_per_block = sbi->blocksize / sbi->sum_blocksize;
+ sbi->entries_in_sum = sbi->sum_blocksize / 8;
+ sbi->sum_entry_size = SUMMARY_SIZE * sbi->entries_in_sum;
+ sbi->sum_journal_size = sbi->sum_blocksize - SUM_FOOTER_SIZE -
+ sbi->sum_entry_size;
+ sbi->nat_journal_entries = (sbi->sum_journal_size - 2) /
+ sizeof(struct nat_journal_entry);
+ sbi->sit_journal_entries = (sbi->sum_journal_size - 2) /
+ sizeof(struct sit_journal_entry);
+
sbi->dir_level = DEF_DIR_LEVEL;
sbi->interval_time[CP_TIME] = DEF_CP_INTERVAL;
sbi->interval_time[REQ_TIME] = DEF_IDLE_INTERVAL;
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -17,7 +17,6 @@
#define F2FS_LOG_SECTORS_PER_BLOCK (PAGE_SHIFT - 9) /* log number for sector/blk */
#define F2FS_BLKSIZE PAGE_SIZE /* support only block == page */
#define F2FS_BLKSIZE_BITS PAGE_SHIFT /* bits for F2FS_BLKSIZE */
-#define F2FS_SUM_BLKSIZE 4096 /* only support 4096 byte sum block */
#define F2FS_MAX_EXTENSION 64 /* # of extension entries */
#define F2FS_EXTENSION_LEN 8 /* max size of extension */
@@ -442,10 +441,8 @@ struct f2fs_sit_block {
* from node's page's beginning to get a data block address.
* ex) data_blkaddr = (block_t)(nodepage_start_address + ofs_in_node)
*/
-#define ENTRIES_IN_SUM (F2FS_SUM_BLKSIZE / 8)
#define SUMMARY_SIZE (7) /* sizeof(struct f2fs_summary) */
#define SUM_FOOTER_SIZE (5) /* sizeof(struct summary_footer) */
-#define SUM_ENTRY_SIZE (SUMMARY_SIZE * ENTRIES_IN_SUM)
/* a summary entry for a block in a segment */
struct f2fs_summary {
@@ -468,22 +465,6 @@ struct summary_footer {
__le32 check_sum; /* summary checksum */
} __packed;
-#define SUM_JOURNAL_SIZE (F2FS_SUM_BLKSIZE - SUM_FOOTER_SIZE -\
- SUM_ENTRY_SIZE)
-#define NAT_JOURNAL_ENTRIES ((SUM_JOURNAL_SIZE - 2) /\
- sizeof(struct nat_journal_entry))
-#define NAT_JOURNAL_RESERVED ((SUM_JOURNAL_SIZE - 2) %\
- sizeof(struct nat_journal_entry))
-#define SIT_JOURNAL_ENTRIES ((SUM_JOURNAL_SIZE - 2) /\
- sizeof(struct sit_journal_entry))
-#define SIT_JOURNAL_RESERVED ((SUM_JOURNAL_SIZE - 2) %\
- sizeof(struct sit_journal_entry))
-
-/* Reserved area should make size of f2fs_extra_info equals to
- * that of nat_journal and sit_journal.
- */
-#define EXTRA_INFO_RESERVED (SUM_JOURNAL_SIZE - 2 - 8)
-
/*
* frequently updated NAT/SIT entries can be stored in the spare area in
* summary blocks
@@ -498,9 +479,16 @@ struct nat_journal_entry {
struct f2fs_nat_entry ne;
} __packed;
+/*
+ * The nat_journal structure is a placeholder whose actual size varies depending
+ * on the use of packed_ssa. Therefore, it must always be accessed only through
+ * specific sets of macros and fields, and size calculations should use
+ * size-related macros instead of sizeof().
+ * Relevant macros: sbi->nat_journal_entries, nat_in_journal(),
+ * nid_in_journal(), MAX_NAT_JENTRIES().
+ */
struct nat_journal {
- struct nat_journal_entry entries[NAT_JOURNAL_ENTRIES];
- __u8 reserved[NAT_JOURNAL_RESERVED];
+ struct nat_journal_entry entries[0];
} __packed;
struct sit_journal_entry {
@@ -508,14 +496,21 @@ struct sit_journal_entry {
struct f2fs_sit_entry se;
} __packed;
+/*
+ * The sit_journal structure is a placeholder whose actual size varies depending
+ * on the use of packed_ssa. Therefore, it must always be accessed only through
+ * specific sets of macros and fields, and size calculations should use
+ * size-related macros instead of sizeof().
+ * Relevant macros: sbi->sit_journal_entries, sit_in_journal(),
+ * segno_in_journal(), MAX_SIT_JENTRIES().
+ */
struct sit_journal {
- struct sit_journal_entry entries[SIT_JOURNAL_ENTRIES];
- __u8 reserved[SIT_JOURNAL_RESERVED];
+ struct sit_journal_entry entries[0];
} __packed;
struct f2fs_extra_info {
__le64 kbytes_written;
- __u8 reserved[EXTRA_INFO_RESERVED];
+ __u8 reserved[];
} __packed;
struct f2fs_journal {
@@ -531,11 +526,33 @@ struct f2fs_journal {
};
} __packed;
-/* Block-sized summary block structure */
+/*
+ * Block-sized summary block structure
+ *
+ * The f2fs_summary_block structure is a placeholder whose actual size varies
+ * depending on the use of packed_ssa. Therefore, it must always be accessed
+ * only through specific sets of macros and fields, and size calculations should
+ * use size-related macros instead of sizeof().
+ * Relevant macros: sbi->sum_blocksize, sbi->entries_in_sum,
+ * sbi->sum_entry_size, sum_entries(), sum_journal(), sum_footer().
+ *
+ * Summary Block Layout
+ *
+ * +-----------------------+ <--- Block Start
+ * | struct f2fs_summary |
+ * | entries[0] |
+ * | ... |
+ * | entries[N-1] |
+ * +-----------------------+
+ * | struct f2fs_journal |
+ * +-----------------------+
+ * | struct summary_footer |
+ * +-----------------------+ <--- Block End
+ */
struct f2fs_summary_block {
- struct f2fs_summary entries[ENTRIES_IN_SUM];
- struct f2fs_journal journal;
- struct summary_footer footer;
+ struct f2fs_summary entries[0];
+ // struct f2fs_journal journal;
+ // struct summary_footer footer;
} __packed;
/*
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 38/43] f2fs: fix to avoid mapping wrong physical block for swapfile
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 37/43] f2fs: support non-4KB block size without packed_ssa feature Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 39/43] f2fs: optimize f2fs_overwrite_io() for f2fs_iomap_begin Greg Kroah-Hartman
` (14 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Daeho Jeong, Chao Yu,
Jaegeuk Kim, Xiaolong Guo
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <chao@kernel.org>
commit 5c145c03188bc9ba1c29e0bc4d527a5978fc47f9 upstream.
Xiaolong Guo reported a f2fs bug in bugzilla [1]
[1] https://bugzilla.kernel.org/show_bug.cgi?id=220951
Quoted:
"When using stress-ng's swap stress test on F2FS filesystem with kernel 6.6+,
the system experiences data corruption leading to either:
1 dm-verity corruption errors and device reboot
2 F2FS node corruption errors and boot hangs
The issue occurs specifically when:
1 Using F2FS filesystem (ext4 is unaffected)
2 Swapfile size is less than F2FS section size (2MB)
3 Swapfile has fragmented physical layout (multiple non-contiguous extents)
4 Kernel version is 6.6+ (6.1 is unaffected)
The root cause is in check_swap_activate() function in fs/f2fs/data.c. When the
first extent of a small swapfile (< 2MB) is not aligned to section boundaries,
the function incorrectly treats it as the last extent, failing to map
subsequent extents. This results in incorrect swap_extent creation where only
the first extent is mapped, causing subsequent swap writes to overwrite wrong
physical locations (other files' data).
Steps to Reproduce
1 Setup a device with F2FS-formatted userdata partition
2 Compile stress-ng from https://github.com/ColinIanKing/stress-ng
3 Run swap stress test: (Android devices)
adb shell "cd /data/stressng; ./stress-ng-64 --metrics-brief --timeout 60
--swap 0"
Log:
1 Ftrace shows in kernel 6.6, only first extent is mapped during second
f2fs_map_blocks call in check_swap_activate():
stress-ng-swap-8990: f2fs_map_blocks: ino=11002, file offset=0, start
blkaddr=0x43143, len=0x1
(Only 4KB mapped, not the full swapfile)
2 in kernel 6.1, both extents are correctly mapped:
stress-ng-swap-5966: f2fs_map_blocks: ino=28011, file offset=0, start
blkaddr=0x13cd4, len=0x1
stress-ng-swap-5966: f2fs_map_blocks: ino=28011, file offset=1, start
blkaddr=0x60c84b, len=0xff
The problematic code is in check_swap_activate():
if ((pblock - SM_I(sbi)->main_blkaddr) % blks_per_sec ||
nr_pblocks % blks_per_sec ||
!f2fs_valid_pinned_area(sbi, pblock)) {
bool last_extent = false;
not_aligned++;
nr_pblocks = roundup(nr_pblocks, blks_per_sec);
if (cur_lblock + nr_pblocks > sis->max)
nr_pblocks -= blks_per_sec;
/* this extent is last one */
if (!nr_pblocks) {
nr_pblocks = last_lblock - cur_lblock;
last_extent = true;
}
ret = f2fs_migrate_blocks(inode, cur_lblock, nr_pblocks);
if (ret) {
if (ret == -ENOENT)
ret = -EINVAL;
goto out;
}
if (!last_extent)
goto retry;
}
When the first extent is unaligned and roundup(nr_pblocks, blks_per_sec)
exceeds sis->max, we subtract blks_per_sec resulting in nr_pblocks = 0. The
code then incorrectly assumes this is the last extent, sets nr_pblocks =
last_lblock - cur_lblock (entire swapfile), and performs migration. After
migration, it doesn't retry mapping, so subsequent extents are never processed.
"
In order to fix this issue, we need to lookup block mapping info after
we migrate all blocks in the tail of swapfile.
Cc: stable@kernel.org
Fixes: 9703d69d9d15 ("f2fs: support file pinning for zoned devices")
Cc: Daeho Jeong <daehojeong@google.com>
Reported-and-tested-by: Xiaolong Guo <guoxiaolong2008@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220951
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/data.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3939,6 +3939,7 @@ static int check_swap_activate(struct sw
while (cur_lblock < last_lblock && cur_lblock < sis->max) {
struct f2fs_map_blocks map;
+ bool last_extent = false;
retry:
cond_resched();
@@ -3964,11 +3965,10 @@ retry:
pblock = map.m_pblk;
nr_pblocks = map.m_len;
- if ((pblock - SM_I(sbi)->main_blkaddr) % blks_per_sec ||
- nr_pblocks % blks_per_sec ||
- f2fs_is_sequential_zone_area(sbi, pblock)) {
- bool last_extent = false;
-
+ if (!last_extent &&
+ ((pblock - SM_I(sbi)->main_blkaddr) % blks_per_sec ||
+ nr_pblocks % blks_per_sec ||
+ f2fs_is_sequential_zone_area(sbi, pblock))) {
not_aligned++;
nr_pblocks = roundup(nr_pblocks, blks_per_sec);
@@ -3989,8 +3989,8 @@ retry:
goto out;
}
- if (!last_extent)
- goto retry;
+ /* lookup block mapping info after block migration */
+ goto retry;
}
if (cur_lblock + nr_pblocks >= sis->max)
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 39/43] f2fs: optimize f2fs_overwrite_io() for f2fs_iomap_begin
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 38/43] f2fs: fix to avoid mapping wrong physical block for swapfile Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 40/43] iommu/arm-smmu-qcom: do not register driver in probe() Greg Kroah-Hartman
` (13 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Sungjong Seo, Sunmin Jeong,
Yeongjin Gil, Chao Yu, Jaegeuk Kim
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yeongjin Gil <youngjin.gil@samsung.com>
commit d860974a7e38d35e9e2c4dc8a9f4223b38b6ad99 upstream.
When overwriting already allocated blocks, f2fs_iomap_begin() calls
f2fs_overwrite_io() to check block mappings. However,
f2fs_overwrite_io() iterates through all mapped blocks in the range,
which can be inefficient for fragmented files with large I/O requests.
This patch optimizes f2fs_overwrite_io() by adding a 'check_first'
parameter and introducing __f2fs_overwrite_io() helper. When called from
f2fs_iomap_begin(), we only check the first mapping to determine if the
range is already allocated, which is sufficient for setting
map.m_may_create.
This optimization significantly reduces the number of f2fs_map_blocks()
calls in f2fs_overwrite_io() when called from f2fs_iomap_begin(),
especially for fragmented files with large I/O requests.
Cc: stable@kernel.org
Fixes: 351bc761338d ("f2fs: optimize f2fs DIO overwrites")
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Reviewed-by: Sunmin Jeong <s_min.jeong@samsung.com>
Signed-off-by: Yeongjin Gil <youngjin.gil@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/data.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1799,7 +1799,8 @@ out:
return err;
}
-bool f2fs_overwrite_io(struct inode *inode, loff_t pos, size_t len)
+static bool __f2fs_overwrite_io(struct inode *inode, loff_t pos, size_t len,
+ bool check_first)
{
struct f2fs_map_blocks map;
block_t last_lblk;
@@ -1821,10 +1822,17 @@ bool f2fs_overwrite_io(struct inode *ino
if (err || map.m_len == 0)
return false;
map.m_lblk += map.m_len;
+ if (check_first)
+ break;
}
return true;
}
+bool f2fs_overwrite_io(struct inode *inode, loff_t pos, size_t len)
+{
+ return __f2fs_overwrite_io(inode, pos, len, false);
+}
+
static int f2fs_xattr_fiemap(struct inode *inode,
struct fiemap_extent_info *fieinfo)
{
@@ -4191,7 +4199,7 @@ static int f2fs_iomap_begin(struct inode
* f2fs_map_lock and f2fs_balance_fs are not necessary.
*/
if ((flags & IOMAP_WRITE) &&
- !f2fs_overwrite_io(inode, offset, length))
+ !__f2fs_overwrite_io(inode, offset, length, true))
map.m_may_create = true;
err = f2fs_map_blocks(inode, &map, F2FS_GET_BLOCK_DIO);
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 40/43] iommu/arm-smmu-qcom: do not register driver in probe()
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 39/43] f2fs: optimize f2fs_overwrite_io() for f2fs_iomap_begin Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 41/43] USB: serial: option: add Telit FN920C04 RNDIS compositions Greg Kroah-Hartman
` (12 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Brown, Robin Murphy,
Bjorn Andersson, Konrad Dybcio, Wang Jiayue, Joerg Roedel,
Danilo Krummrich, Ioana Ciornei
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danilo Krummrich <dakr@kernel.org>
commit ed1ac3c977dd6b119405fa36dd41f7151bd5b4de upstream.
Commit 0b4eeee2876f ("iommu/arm-smmu-qcom: Register the TBU driver in
qcom_smmu_impl_init") intended to also probe the TBU driver when
CONFIG_ARM_SMMU_QCOM_DEBUG is disabled, but also moved the corresponding
platform_driver_register() call into qcom_smmu_impl_init() which is
called from arm_smmu_device_probe().
However, it neither makes sense to register drivers from probe()
callbacks of other drivers, nor does the driver core allow registering
drivers with a device lock already being held.
The latter was revealed by commit dc23806a7c47 ("driver core: enforce
device_lock for driver_match_device()") leading to a deadlock condition
described in [1].
Additionally, it was noted by Robin that the current approach is
potentially racy with async probe [2].
Hence, fix this by registering the qcom_smmu_tbu_driver from
module_init(). Unfortunately, due to the vendoring of the driver, this
requires an indirection through arm-smmu-impl.c.
Reported-by: Mark Brown <broonie@kernel.org>
Closes: https://lore.kernel.org/lkml/7ae38e31-ef31-43ad-9106-7c76ea0e8596@sirena.org.uk/
Link: https://lore.kernel.org/lkml/DFU7CEPUSG9A.1KKGVW4HIPMSH@kernel.org/ [1]
Link: https://lore.kernel.org/lkml/0c0d3707-9ea5-44f9-88a1-a65c62e3df8d@arm.com/ [2]
Fixes: dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()")
Fixes: 0b4eeee2876f ("iommu/arm-smmu-qcom: Register the TBU driver in qcom_smmu_impl_init")
Acked-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Acked-by: Konrad Dybcio <konradybcio@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> #LX2160ARDB
Tested-by: Wang Jiayue <akaieurus@gmail.com>
Reviewed-by: Wang Jiayue <akaieurus@gmail.com>
Tested-by: Mark Brown <broonie@kernel.org>
Acked-by: Joerg Roedel <joerg.roedel@amd.com>
Link: https://patch.msgid.link/20260121141215.29658-1-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 14 ++++++++++++++
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 14 ++++++++++----
drivers/iommu/arm/arm-smmu/arm-smmu.c | 24 +++++++++++++++++++++++-
drivers/iommu/arm/arm-smmu/arm-smmu.h | 5 +++++
4 files changed, 52 insertions(+), 5 deletions(-)
--- a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c
@@ -228,3 +228,17 @@ struct arm_smmu_device *arm_smmu_impl_in
return smmu;
}
+
+int __init arm_smmu_impl_module_init(void)
+{
+ if (IS_ENABLED(CONFIG_ARM_SMMU_QCOM))
+ return qcom_smmu_module_init();
+
+ return 0;
+}
+
+void __exit arm_smmu_impl_module_exit(void)
+{
+ if (IS_ENABLED(CONFIG_ARM_SMMU_QCOM))
+ qcom_smmu_module_exit();
+}
--- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
@@ -773,10 +773,6 @@ struct arm_smmu_device *qcom_smmu_impl_i
{
const struct device_node *np = smmu->dev->of_node;
const struct of_device_id *match;
- static u8 tbu_registered;
-
- if (!tbu_registered++)
- platform_driver_register(&qcom_smmu_tbu_driver);
#ifdef CONFIG_ACPI
if (np == NULL) {
@@ -801,3 +797,13 @@ struct arm_smmu_device *qcom_smmu_impl_i
return smmu;
}
+
+int __init qcom_smmu_module_init(void)
+{
+ return platform_driver_register(&qcom_smmu_tbu_driver);
+}
+
+void __exit qcom_smmu_module_exit(void)
+{
+ platform_driver_unregister(&qcom_smmu_tbu_driver);
+}
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -2362,7 +2362,29 @@ static struct platform_driver arm_smmu_d
.remove = arm_smmu_device_remove,
.shutdown = arm_smmu_device_shutdown,
};
-module_platform_driver(arm_smmu_driver);
+
+static int __init arm_smmu_init(void)
+{
+ int ret;
+
+ ret = platform_driver_register(&arm_smmu_driver);
+ if (ret)
+ return ret;
+
+ ret = arm_smmu_impl_module_init();
+ if (ret)
+ platform_driver_unregister(&arm_smmu_driver);
+
+ return ret;
+}
+module_init(arm_smmu_init);
+
+static void __exit arm_smmu_exit(void)
+{
+ arm_smmu_impl_module_exit();
+ platform_driver_unregister(&arm_smmu_driver);
+}
+module_exit(arm_smmu_exit);
MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
MODULE_AUTHOR("Will Deacon <will@kernel.org>");
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.h
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h
@@ -540,6 +540,11 @@ struct arm_smmu_device *arm_smmu_impl_in
struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device *smmu);
struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu);
+int __init arm_smmu_impl_module_init(void);
+void __exit arm_smmu_impl_module_exit(void);
+int __init qcom_smmu_module_init(void);
+void __exit qcom_smmu_module_exit(void);
+
void arm_smmu_write_context_bank(struct arm_smmu_device *smmu, int idx);
int arm_mmu500_reset(struct arm_smmu_device *smmu);
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 41/43] USB: serial: option: add Telit FN920C04 RNDIS compositions
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 40/43] iommu/arm-smmu-qcom: do not register driver in probe() Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 42/43] f2fs: fix to do sanity check on node footer in __write_node_folio() Greg Kroah-Hartman
` (11 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Fabio Porcedda, Johan Hovold
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Porcedda <fabio.porcedda@gmail.com>
commit 509f403f3ccec14188036212118651bf23599396 upstream.
Add the following compositions:
0x10a1: RNDIS + tty (AT/NMEA) + tty (AT) + tty (diag)
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 9 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1bc7 ProdID=10a1 Rev=05.15
S: Manufacturer=Telit Cinterion
S: Product=FN920
S: SerialNumber=d128dba9
C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
0x10a6: RNDIS + tty (AT/NMEA) + tty (AT) + tty (diag)
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 10 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1bc7 ProdID=10a6 Rev=05.15
S: Manufacturer=Telit Cinterion
S: Product=FN920
S: SerialNumber=d128dba9
C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
0x10ab: RNDIS + tty (AT) + tty (diag) + DPL (Data Packet Logging) + adb
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 11 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1bc7 ProdID=10ab Rev=05.15
S: Manufacturer=Telit Cinterion
S: Product=FN920
S: SerialNumber=d128dba9
C: #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 4 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none)
E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
Cc: stable@vger.kernel.org
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/serial/option.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1401,12 +1401,16 @@ static const struct usb_device_id option
.driver_info = NCTRL(0) | RSVD(1) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a0, 0xff), /* Telit FN20C04 (rmnet) */
.driver_info = RSVD(0) | NCTRL(3) },
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a1, 0xff), /* Telit FN20C04 (RNDIS) */
+ .driver_info = NCTRL(4) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a2, 0xff), /* Telit FN920C04 (MBIM) */
.driver_info = NCTRL(4) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a3, 0xff), /* Telit FN920C04 (ECM) */
.driver_info = NCTRL(4) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a4, 0xff), /* Telit FN20C04 (rmnet) */
.driver_info = RSVD(0) | NCTRL(3) },
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a6, 0xff), /* Telit FN920C04 (RNDIS) */
+ .driver_info = NCTRL(4) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a7, 0xff), /* Telit FN920C04 (MBIM) */
.driver_info = NCTRL(4) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a8, 0xff), /* Telit FN920C04 (ECM) */
@@ -1415,6 +1419,8 @@ static const struct usb_device_id option
.driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10aa, 0xff), /* Telit FN920C04 (MBIM) */
.driver_info = NCTRL(3) | RSVD(4) | RSVD(5) },
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10ab, 0xff), /* Telit FN920C04 (RNDIS) */
+ .driver_info = NCTRL(3) | RSVD(4) | RSVD(5) },
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b0, 0xff, 0xff, 0x30), /* Telit FE990B (rmnet) */
.driver_info = NCTRL(5) },
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b0, 0xff, 0xff, 0x40) },
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 42/43] f2fs: fix to do sanity check on node footer in __write_node_folio()
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 41/43] USB: serial: option: add Telit FN920C04 RNDIS compositions Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 43/43] f2fs: fix to do sanity check on node footer in {read,write}_end_io Greg Kroah-Hartman
` (10 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chao Yu, Jaegeuk Kim, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <chao@kernel.org>
[ Upstream commit 0a736109c9d29de0c26567e42cb99b27861aa8ba ]
Add node footer sanity check during node folio's writeback, if sanity
check fails, let's shutdown filesystem to avoid looping to redirty
and writeback in .writepages.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/node.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1751,7 +1751,11 @@ static bool __write_node_folio(struct fo
/* get old block addr of this node page */
nid = nid_of_node(folio);
- f2fs_bug_on(sbi, folio->index != nid);
+
+ if (sanity_check_node_footer(sbi, folio, nid, NODE_TYPE_REGULAR)) {
+ f2fs_handle_critical_error(sbi, STOP_CP_REASON_CORRUPTED_NID);
+ goto redirty_out;
+ }
if (f2fs_get_node_info(sbi, nid, &ni, !do_balance))
goto redirty_out;
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 6.18 43/43] f2fs: fix to do sanity check on node footer in {read,write}_end_io
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 42/43] f2fs: fix to do sanity check on node footer in __write_node_folio() Greg Kroah-Hartman
@ 2026-02-17 20:32 ` Greg Kroah-Hartman
2026-02-17 23:04 ` [PATCH 6.18 00/43] 6.18.13-rc1 review Florian Fainelli
` (9 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-17 20:32 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, syzbot+803dd716c4310d16ff3a,
Chao Yu, Jaegeuk Kim, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <chao@kernel.org>
[ Upstream commit 50ac3ecd8e05b6bcc350c71a4307d40c030ec7e4 ]
-----------[ cut here ]------------
kernel BUG at fs/f2fs/data.c:358!
Call Trace:
<IRQ>
blk_update_request+0x5eb/0xe70 block/blk-mq.c:987
blk_mq_end_request+0x3e/0x70 block/blk-mq.c:1149
blk_complete_reqs block/blk-mq.c:1224 [inline]
blk_done_softirq+0x107/0x160 block/blk-mq.c:1229
handle_softirqs+0x283/0x870 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680
irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050
</IRQ>
In f2fs_write_end_io(), it detects there is inconsistency in between
node page index (nid) and footer.nid of node page.
If footer of node page is corrupted in fuzzed image, then we load corrupted
node page w/ async method, e.g. f2fs_ra_node_pages() or f2fs_ra_node_page(),
in where we won't do sanity check on node footer, once node page becomes
dirty, we will encounter this bug after node page writeback.
Cc: stable@kernel.org
Reported-by: syzbot+803dd716c4310d16ff3a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=803dd716c4310d16ff3a
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[ Context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/f2fs/data.c | 13 +++++++++++--
fs/f2fs/f2fs.h | 12 ++++++++++++
fs/f2fs/node.c | 20 +++++++++++---------
fs/f2fs/node.h | 8 --------
4 files changed, 34 insertions(+), 19 deletions(-)
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -151,6 +151,12 @@ static void f2fs_finish_read_bio(struct
}
dec_page_count(F2FS_F_SB(folio), __read_io_type(folio));
+
+ if (F2FS_F_SB(folio)->node_inode && is_node_folio(folio) &&
+ f2fs_sanity_check_node_footer(F2FS_F_SB(folio),
+ folio, folio->index, NODE_TYPE_REGULAR, true))
+ bio->bi_status = BLK_STS_IOERR;
+
folio_end_read(folio, bio->bi_status == BLK_STS_OK);
}
@@ -352,8 +358,11 @@ static void f2fs_write_end_io(struct bio
STOP_CP_REASON_WRITE_FAIL);
}
- f2fs_bug_on(sbi, is_node_folio(folio) &&
- folio->index != nid_of_node(folio));
+ if (is_node_folio(folio)) {
+ f2fs_sanity_check_node_footer(sbi, folio,
+ folio->index, NODE_TYPE_REGULAR, true);
+ f2fs_bug_on(sbi, folio->index != nid_of_node(folio));
+ }
dec_page_count(sbi, type);
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1516,6 +1516,15 @@ enum f2fs_lookup_mode {
LOOKUP_AUTO,
};
+/* For node type in __get_node_folio() */
+enum node_type {
+ NODE_TYPE_REGULAR,
+ NODE_TYPE_INODE,
+ NODE_TYPE_XATTR,
+ NODE_TYPE_NON_INODE,
+};
+
+
static inline int f2fs_test_bit(unsigned int nr, char *addr);
static inline void f2fs_set_bit(unsigned int nr, char *addr);
static inline void f2fs_clear_bit(unsigned int nr, char *addr);
@@ -3874,6 +3883,9 @@ struct folio *f2fs_new_node_folio(struct
void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid);
struct folio *f2fs_get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid,
enum node_type node_type);
+int f2fs_sanity_check_node_footer(struct f2fs_sb_info *sbi,
+ struct folio *folio, pgoff_t nid,
+ enum node_type ntype, bool in_irq);
struct folio *f2fs_get_inode_folio(struct f2fs_sb_info *sbi, pgoff_t ino);
struct folio *f2fs_get_xnode_folio(struct f2fs_sb_info *sbi, pgoff_t xnid);
int f2fs_move_node_folio(struct folio *node_folio, int gc_type);
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1500,9 +1500,9 @@ void f2fs_ra_node_page(struct f2fs_sb_in
f2fs_folio_put(afolio, err ? true : false);
}
-static int sanity_check_node_footer(struct f2fs_sb_info *sbi,
+int f2fs_sanity_check_node_footer(struct f2fs_sb_info *sbi,
struct folio *folio, pgoff_t nid,
- enum node_type ntype)
+ enum node_type ntype, bool in_irq)
{
if (unlikely(nid != nid_of_node(folio)))
goto out_err;
@@ -1527,12 +1527,13 @@ static int sanity_check_node_footer(stru
goto out_err;
return 0;
out_err:
- f2fs_warn(sbi, "inconsistent node block, node_type:%d, nid:%lu, "
- "node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
- ntype, nid, nid_of_node(folio), ino_of_node(folio),
- ofs_of_node(folio), cpver_of_node(folio),
- next_blkaddr_of_node(folio));
set_sbi_flag(sbi, SBI_NEED_FSCK);
+ f2fs_warn_ratelimited(sbi, "inconsistent node block, node_type:%d, nid:%lu, "
+ "node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
+ ntype, nid, nid_of_node(folio), ino_of_node(folio),
+ ofs_of_node(folio), cpver_of_node(folio),
+ next_blkaddr_of_node(folio));
+
f2fs_handle_error(sbi, ERROR_INCONSISTENT_FOOTER);
return -EFSCORRUPTED;
}
@@ -1578,7 +1579,7 @@ repeat:
goto out_err;
}
page_hit:
- err = sanity_check_node_footer(sbi, folio, nid, ntype);
+ err = f2fs_sanity_check_node_footer(sbi, folio, nid, ntype, false);
if (!err)
return folio;
out_err:
@@ -1752,7 +1753,8 @@ static bool __write_node_folio(struct fo
/* get old block addr of this node page */
nid = nid_of_node(folio);
- if (sanity_check_node_footer(sbi, folio, nid, NODE_TYPE_REGULAR)) {
+ if (f2fs_sanity_check_node_footer(sbi, folio, nid,
+ NODE_TYPE_REGULAR, false)) {
f2fs_handle_critical_error(sbi, STOP_CP_REASON_CORRUPTED_NID);
goto redirty_out;
}
--- a/fs/f2fs/node.h
+++ b/fs/f2fs/node.h
@@ -52,14 +52,6 @@ enum {
IS_PREALLOC, /* nat entry is preallocated */
};
-/* For node type in __get_node_folio() */
-enum node_type {
- NODE_TYPE_REGULAR,
- NODE_TYPE_INODE,
- NODE_TYPE_XATTR,
- NODE_TYPE_NON_INODE,
-};
-
/*
* For node information
*/
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2026-02-17 20:32 ` [PATCH 6.18 43/43] f2fs: fix to do sanity check on node footer in {read,write}_end_io Greg Kroah-Hartman
@ 2026-02-17 23:04 ` Florian Fainelli
2026-02-18 3:45 ` Peter Schneider
` (8 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Florian Fainelli @ 2026-02-17 23:04 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, sudipm.mukherjee, rwarsow, conor,
hargar, broonie, achill, sr
On 2/17/26 12:31, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.13 release.
> There are 43 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 Thu, 19 Feb 2026 19:59:50 +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/v6.x/stable-review/patch-6.18.13-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on
BMIPS_GENERIC:
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2026-02-17 23:04 ` [PATCH 6.18 00/43] 6.18.13-rc1 review Florian Fainelli
@ 2026-02-18 3:45 ` Peter Schneider
2026-02-18 8:23 ` Jon Hunter
` (7 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Peter Schneider @ 2026-02-18 3:45 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
Am 17.02.2026 um 21:31 schrieb Greg Kroah-Hartman:
> This is the start of the stable review cycle for the 6.18.13 release.
> There are 43 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.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Beste Grüße,
Peter Schneider
--
Climb the mountain not to plant your flag, but to embrace the challenge,
enjoy the air and behold the view. Climb it so you can see the world,
not so the world can see you. -- David McCullough Jr.
OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244
Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@googlemail.com
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@gmail.com
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2026-02-18 3:45 ` Peter Schneider
@ 2026-02-18 8:23 ` Jon Hunter
2026-02-18 9:09 ` Brett A C Sheffield
` (6 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Jon Hunter @ 2026-02-18 8:23 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr,
linux-tegra, stable
On Tue, 17 Feb 2026 21:31:40 +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.13 release.
> There are 43 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 Thu, 19 Feb 2026 19:59:50 +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/v6.x/stable-review/patch-6.18.13-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
All tests passing for Tegra ...
Test results for stable-v6.18:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
133 tests: 133 pass, 0 fail
Linux version: 6.18.13-rc1-gbfeb67747626
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
tegra194-p3509-0000+p3668-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Jon
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2026-02-18 8:23 ` Jon Hunter
@ 2026-02-18 9:09 ` Brett A C Sheffield
2026-02-18 12:17 ` Luna Jernberg
` (5 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Brett A C Sheffield @ 2026-02-18 9:09 UTC (permalink / raw)
To: gregkh
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr,
Brett A C Sheffield
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.18.13-rc1-gbfeb67747626 #1 SMP PREEMPT_DYNAMIC Wed Feb 18 08:30:25 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Tested-by: Brett A C Sheffield <bacs@librecast.net>
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2026-02-18 9:09 ` Brett A C Sheffield
@ 2026-02-18 12:17 ` Luna Jernberg
2026-02-18 16:48 ` Jeffrin Thalakkottoor
` (4 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Luna Jernberg @ 2026-02-18 12:17 UTC (permalink / raw)
To: Greg Kroah-Hartman, Luna Jernberg
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
Tested on: Arch Linux Machine a Dell Micro 3050 with a
model name : Intel(R) Core(TM) i5-6500T CPU @ 2.50GHz
and works as it should
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Den tis 17 feb. 2026 kl 21:52 skrev Greg Kroah-Hartman
<gregkh@linuxfoundation.org>:
>
> This is the start of the stable review cycle for the 6.18.13 release.
> There are 43 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 Thu, 19 Feb 2026 19:59:50 +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/v6.x/stable-review/patch-6.18.13-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
> -------------
> Pseudo-Shortlog of commits:
>
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Linux 6.18.13-rc1
>
> Chao Yu <chao@kernel.org>
> f2fs: fix to do sanity check on node footer in {read,write}_end_io
>
> Chao Yu <chao@kernel.org>
> f2fs: fix to do sanity check on node footer in __write_node_folio()
>
> Fabio Porcedda <fabio.porcedda@gmail.com>
> USB: serial: option: add Telit FN920C04 RNDIS compositions
>
> Danilo Krummrich <dakr@kernel.org>
> iommu/arm-smmu-qcom: do not register driver in probe()
>
> Yeongjin Gil <youngjin.gil@samsung.com>
> f2fs: optimize f2fs_overwrite_io() for f2fs_iomap_begin
>
> Chao Yu <chao@kernel.org>
> f2fs: fix to avoid mapping wrong physical block for swapfile
>
> Daeho Jeong <daehojeong@google.com>
> f2fs: support non-4KB block size without packed_ssa feature
>
> Chao Yu <chao@kernel.org>
> f2fs: fix to avoid UAF in f2fs_write_end_io()
>
> Yongpeng Yang <yangyongpeng@xiaomi.com>
> f2fs: fix out-of-bounds access in sysfs attribute read/write
>
> Yongpeng Yang <yangyongpeng@xiaomi.com>
> f2fs: fix IS_CHECKPOINTED flag inconsistency issue caused by concurrent atomic commit and checkpoint writes
>
> Chao Yu <chao@kernel.org>
> f2fs: fix to check sysfs filename w/ gc_pin_file_thresh correctly
>
> Zhiguo Niu <zhiguo.niu@unisoc.com>
> f2fs: fix to add gc count stat in f2fs_gc_range
>
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> fbdev: smscufx: properly copy ioctl memory to kernelspace
>
> Guangshuo Li <lgs201920130244@gmail.com>
> fbdev: rivafb: fix divide error in nv3_arb()
>
> Chen Ridong <chenridong@huawei.com>
> cpuset: Fix missing adaptation for cpuset_is_populated
>
> Tiezhu Yang <yangtiezhu@loongson.cn>
> LoongArch: Rework KASAN initialization for PTW-enabled systems
>
> David Hildenbrand (Red Hat) <david@kernel.org>
> mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather
>
> Otto Pflüger <otto.pflueger@abscue.de>
> arm64: dts: mediatek: mt8183: Add missing endpoint IDs to display graph
>
> Alban Bedel <alban.bedel@lht.dlh.de>
> gpiolib: acpi: Fix gpio count with string references
>
> Jens Axboe <axboe@kernel.dk>
> io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs
>
> Ziyi Guo <n7l8m4@u.northwestern.edu>
> ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put()
>
> Melissa Wen <mwen@igalia.com>
> drm/amd/display: remove assert around dpp_base replacement
>
> Melissa Wen <mwen@igalia.com>
> drm/amd/display: extend delta clamping logic to CM3 LUT helper
>
> Deepanshu Kartikey <kartikey406@gmail.com>
> tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow
>
> Charles Keepax <ckeepax@opensource.cirrus.com>
> ASoC: cs42l43: Correct handling of 3-pole jack load detection
>
> Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> platform/x86: panasonic-laptop: Fix sysfs group leak in error path
>
> Maciej Strozek <mstrozek@opensource.cirrus.com>
> ASoC: sof_sdw: Add a quirk for Lenovo laptop using sidecar amps with cs42l43
>
> gongqi <550230171hxy@gmail.com>
> platform/x86/amd/pmc: Add quirk for MECHREVO Wujie 15X Pro
>
> Breno Baptista <brenomb07@gmail.com>
> ALSA: hda/realtek: Enable headset mic for Acer Nitro 5
>
> Dirk Su <dirk.su@canonical.com>
> ASoC: amd: yc: Add quirk for HP 200 G2a 16
>
> Tagir Garaev <tgaraev653@gmail.com>
> ASoC: Intel: sof_es8336: Add DMI quirk for Huawei BOD-WXX9
>
> Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> platform/x86: classmate-laptop: Add missing NULL pointer checks
>
> Brahmajit Das <listout@listout.xyz>
> drm/tegra: hdmi: sor: Fix error: variable ‘j’ set but not used
>
> Deepanshu Kartikey <kartikey406@gmail.com>
> romfs: check sb_set_blocksize() return value
>
> Kailang Yang <kailang@realtek.com>
> ALSA: hda/realtek - fixed speaker no sound
>
> Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
> ASoC: cs35l45: Corrects ASP_TX5 DAPM widget channel
>
> Zhang Heng <zhangheng@kylinos.cn>
> ALSA: hda/realtek: Add quirk for Inspur S14-G1
>
> Xuewen Yan <xuewen.yan@unisoc.com>
> gpio: sprd: Change sprd_gpio lock to raw_spin_lock
>
> Anatolii Shirykalov <pipocavsobake@gmail.com>
> ASoC: amd: yc: Add ASUS ExpertBook PM1503CDA to quirks list
>
> Alice Ryhl <aliceryhl@google.com>
> rust: driver: fix broken intra-doc links to example driver types
>
> FUJITA Tomonori <fujita.tomonori@gmail.com>
> rust: dma: fix broken intra-doc links
>
> FUJITA Tomonori <fujita.tomonori@gmail.com>
> rust: device: fix broken intra-doc links
>
> Anil Gurumurthy <agurumurthy@marvell.com>
> scsi: qla2xxx: Fix bsg_done() causing double free
>
>
> -------------
>
> Diffstat:
>
> Makefile | 4 +-
> arch/arm64/boot/dts/mediatek/mt8183.dtsi | 37 ++++++-
> arch/loongarch/mm/kasan_init.c | 80 +++++++-------
> drivers/gpio/gpio-sprd.c | 8 +-
> drivers/gpio/gpiolib-acpi-core.c | 1 +
> .../gpu/drm/amd/display/dc/dcn30/dcn30_cm_common.c | 30 ++++-
> .../drm/amd/display/dc/dwb/dcn30/dcn30_cm_common.h | 2 +-
> .../drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 9 +-
> .../drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 18 +--
> .../drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 16 +--
> drivers/gpu/drm/tegra/hdmi.c | 4 +-
> drivers/gpu/drm/tegra/sor.c | 4 +-
> drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 14 +++
> drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 14 ++-
> drivers/iommu/arm/arm-smmu/arm-smmu.c | 24 +++-
> drivers/iommu/arm/arm-smmu/arm-smmu.h | 5 +
> drivers/platform/x86/amd/pmc/pmc-quirks.c | 7 ++
> drivers/platform/x86/classmate-laptop.c | 32 ++++++
> drivers/platform/x86/panasonic-laptop.c | 4 +-
> drivers/scsi/qla2xxx/qla_bsg.c | 28 +++--
> drivers/usb/serial/option.c | 6 +
> drivers/video/fbdev/riva/riva_hw.c | 3 +
> drivers/video/fbdev/smscufx.c | 8 +-
> fs/f2fs/data.c | 51 ++++++---
> fs/f2fs/f2fs.h | 64 ++++++++---
> fs/f2fs/gc.c | 24 ++--
> fs/f2fs/node.c | 50 +++++----
> fs/f2fs/node.h | 8 --
> fs/f2fs/recovery.c | 6 +-
> fs/f2fs/segment.c | 86 +++++++-------
> fs/f2fs/segment.h | 9 +-
> fs/f2fs/super.c | 26 ++---
> fs/f2fs/sysfs.c | 62 +++++++++--
> fs/romfs/super.c | 5 +-
> include/asm-generic/tlb.h | 77 ++++++++++++-
> include/linux/f2fs_fs.h | 73 +++++++-----
> include/linux/hugetlb.h | 15 ++-
> include/linux/mm_types.h | 1 +
> include/trace/events/dma.h | 25 ++++-
> io_uring/fdinfo.c | 11 +-
> kernel/cgroup/cpuset.c | 2 +-
> mm/hugetlb.c | 123 ++++++++++++---------
> mm/mmu_gather.c | 33 ++++++
> mm/rmap.c | 25 +++--
> rust/kernel/device.rs | 6 +-
> rust/kernel/dma.rs | 5 +-
> rust/kernel/driver.rs | 12 +-
> sound/hda/codecs/realtek/alc269.c | 13 +++
> sound/soc/amd/yc/acp6x-mach.c | 14 +++
> sound/soc/codecs/cs35l45.c | 2 +-
> sound/soc/codecs/cs42l43-jack.c | 37 ++++++-
> sound/soc/fsl/fsl_xcvr.c | 3 +
> sound/soc/intel/boards/sof_es8336.c | 9 ++
> sound/soc/intel/boards/sof_sdw.c | 1 +
> 54 files changed, 877 insertions(+), 359 deletions(-)
>
>
>
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2026-02-18 12:17 ` Luna Jernberg
@ 2026-02-18 16:48 ` Jeffrin Thalakkottoor
2026-02-18 23:42 ` Mark Brown
` (3 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Jeffrin Thalakkottoor @ 2026-02-18 16:48 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
hello,
Compiled and booted 6.18.13-rc1+
No typical dmesg regressions.
Tested-by: Jeffrin Jose T <jeffrin@rajagiritech.edu.in>
--
software engineer
rajagiri school of engineering and technology-
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2026-02-18 16:48 ` Jeffrin Thalakkottoor
@ 2026-02-18 23:42 ` Mark Brown
2026-02-19 1:00 ` Justin Forbes
` (2 subsequent siblings)
52 siblings, 0 replies; 55+ messages in thread
From: Mark Brown @ 2026-02-18 23:42 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, achill, sr
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
On Tue, Feb 17, 2026 at 09:31:40PM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.13 release.
> There are 43 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.
Tested-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2026-02-18 23:42 ` Mark Brown
@ 2026-02-19 1:00 ` Justin Forbes
2026-02-19 6:27 ` Ron Economos
2026-02-19 12:46 ` Miguel Ojeda
52 siblings, 0 replies; 55+ messages in thread
From: Justin Forbes @ 2026-02-19 1:00 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On Tue, Feb 17, 2026 at 09:31:40PM +0100, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.13 release.
> There are 43 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 Thu, 19 Feb 2026 19:59:50 +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/v6.x/stable-review/patch-6.18.13-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
Tested rc1 against the Fedora build system (aarch64, ppc64le, s390x,
x86_64), and boot tested x86_64. No regressions noted.
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2026-02-19 1:00 ` Justin Forbes
@ 2026-02-19 6:27 ` Ron Economos
2026-02-19 12:46 ` Miguel Ojeda
52 siblings, 0 replies; 55+ messages in thread
From: Ron Economos @ 2026-02-19 6:27 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
On 2/17/26 12:31, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.13 release.
> There are 43 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 Thu, 19 Feb 2026 19:59:50 +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/v6.x/stable-review/patch-6.18.13-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Tested-by: Ron Economos <re@w6rz.net>
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 00/43] 6.18.13-rc1 review
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2026-02-19 6:27 ` Ron Economos
@ 2026-02-19 12:46 ` Miguel Ojeda
52 siblings, 0 replies; 55+ messages in thread
From: Miguel Ojeda @ 2026-02-19 12:46 UTC (permalink / raw)
To: gregkh
Cc: achill, akpm, broonie, conor, f.fainelli, hargar, jonathanh,
linux-kernel, linux, lkft-triage, patches, patches, pavel,
rwarsow, shuah, sr, stable, sudipm.mukherjee, torvalds,
Miguel Ojeda
On Tue, 17 Feb 2026 21:31:40 +0100 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 6.18.13 release.
> There are 43 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 Thu, 19 Feb 2026 19:59:50 +0000.
> Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested
for loongarch64:
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 6.18 26/43] arm64: dts: mediatek: mt8183: Add missing endpoint IDs to display graph
2026-02-17 20:32 ` [PATCH 6.18 26/43] arm64: dts: mediatek: mt8183: Add missing endpoint IDs to display graph Greg Kroah-Hartman
@ 2026-03-04 7:03 ` Evans Jahja
0 siblings, 0 replies; 55+ messages in thread
From: Evans Jahja @ 2026-03-04 7:03 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, Chen-Yu Tsai, Otto Pflüger,
AngeloGioacchino Del Regno, Thorsten Leemhuis
> 6.18-stable review patch. If anyone has any objections, please let me know.
I reported this but unfortunately life gets in the way and I am unable
to test, please go ahead with the release. Thanks for the hard work!
^ permalink raw reply [flat|nested] 55+ messages in thread
end of thread, other threads:[~2026-03-04 7:04 UTC | newest]
Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-17 20:31 [PATCH 6.18 00/43] 6.18.13-rc1 review Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 01/43] scsi: qla2xxx: Fix bsg_done() causing double free Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 02/43] rust: device: fix broken intra-doc links Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 03/43] rust: dma: " Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 04/43] rust: driver: fix broken intra-doc links to example driver types Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 05/43] ASoC: amd: yc: Add ASUS ExpertBook PM1503CDA to quirks list Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 06/43] gpio: sprd: Change sprd_gpio lock to raw_spin_lock Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 07/43] ALSA: hda/realtek: Add quirk for Inspur S14-G1 Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 08/43] ASoC: cs35l45: Corrects ASP_TX5 DAPM widget channel Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 09/43] ALSA: hda/realtek - fixed speaker no sound Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 10/43] romfs: check sb_set_blocksize() return value Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 11/43] =?UTF-8?q?drm/tegra:=20hdmi:=20sor:=20Fix=20error:=20variable=20?= =?UTF-8?q?=E2=80=98j=E2=80=99=20set=20but=20not=20used?= Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 12/43] platform/x86: classmate-laptop: Add missing NULL pointer checks Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 13/43] ASoC: Intel: sof_es8336: Add DMI quirk for Huawei BOD-WXX9 Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 14/43] ASoC: amd: yc: Add quirk for HP 200 G2a 16 Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 15/43] ALSA: hda/realtek: Enable headset mic for Acer Nitro 5 Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 16/43] platform/x86/amd/pmc: Add quirk for MECHREVO Wujie 15X Pro Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 17/43] ASoC: sof_sdw: Add a quirk for Lenovo laptop using sidecar amps with cs42l43 Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 18/43] platform/x86: panasonic-laptop: Fix sysfs group leak in error path Greg Kroah-Hartman
2026-02-17 20:31 ` [PATCH 6.18 19/43] ASoC: cs42l43: Correct handling of 3-pole jack load detection Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 20/43] tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 21/43] drm/amd/display: extend delta clamping logic to CM3 LUT helper Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 22/43] drm/amd/display: remove assert around dpp_base replacement Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 23/43] ASoC: fsl_xcvr: fix missing lock in fsl_xcvr_mode_put() Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 24/43] io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 25/43] gpiolib: acpi: Fix gpio count with string references Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 26/43] arm64: dts: mediatek: mt8183: Add missing endpoint IDs to display graph Greg Kroah-Hartman
2026-03-04 7:03 ` Evans Jahja
2026-02-17 20:32 ` [PATCH 6.18 27/43] mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 28/43] LoongArch: Rework KASAN initialization for PTW-enabled systems Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 29/43] cpuset: Fix missing adaptation for cpuset_is_populated Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 30/43] fbdev: rivafb: fix divide error in nv3_arb() Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 31/43] fbdev: smscufx: properly copy ioctl memory to kernelspace Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 32/43] f2fs: fix to add gc count stat in f2fs_gc_range Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 33/43] f2fs: fix to check sysfs filename w/ gc_pin_file_thresh correctly Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 34/43] f2fs: fix IS_CHECKPOINTED flag inconsistency issue caused by concurrent atomic commit and checkpoint writes Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 35/43] f2fs: fix out-of-bounds access in sysfs attribute read/write Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 36/43] f2fs: fix to avoid UAF in f2fs_write_end_io() Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 37/43] f2fs: support non-4KB block size without packed_ssa feature Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 38/43] f2fs: fix to avoid mapping wrong physical block for swapfile Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 39/43] f2fs: optimize f2fs_overwrite_io() for f2fs_iomap_begin Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 40/43] iommu/arm-smmu-qcom: do not register driver in probe() Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 41/43] USB: serial: option: add Telit FN920C04 RNDIS compositions Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 42/43] f2fs: fix to do sanity check on node footer in __write_node_folio() Greg Kroah-Hartman
2026-02-17 20:32 ` [PATCH 6.18 43/43] f2fs: fix to do sanity check on node footer in {read,write}_end_io Greg Kroah-Hartman
2026-02-17 23:04 ` [PATCH 6.18 00/43] 6.18.13-rc1 review Florian Fainelli
2026-02-18 3:45 ` Peter Schneider
2026-02-18 8:23 ` Jon Hunter
2026-02-18 9:09 ` Brett A C Sheffield
2026-02-18 12:17 ` Luna Jernberg
2026-02-18 16:48 ` Jeffrin Thalakkottoor
2026-02-18 23:42 ` Mark Brown
2026-02-19 1:00 ` Justin Forbes
2026-02-19 6:27 ` Ron Economos
2026-02-19 12:46 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox