--- /dev/null
+From b32cc17d607e8ae7af037303fe101368cb4dc44c Mon Sep 17 00:00:00 2001
+From: Yihang Li <liyihang9@h-partners.com>
+Date: Thu, 20 Nov 2025 11:50:23 +0800
+Subject: ata: libata-scsi: Add missing scsi_device_put() in ata_scsi_dev_rescan()
+
+From: Yihang Li <liyihang9@h-partners.com>
+
+commit b32cc17d607e8ae7af037303fe101368cb4dc44c upstream.
+
+Call scsi_device_put() in ata_scsi_dev_rescan() if the device or its
+queue are not running.
+
+Fixes: 0c76106cb975 ("scsi: sd: Fix TCG OPAL unlock on system resume")
+Cc: stable@vger.kernel.org
+Signed-off-by: Yihang Li <liyihang9@h-partners.com>
+Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
+Signed-off-by: Niklas Cassel <cassel@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/ata/libata-scsi.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -4683,8 +4683,10 @@ void ata_scsi_dev_rescan(struct work_str
+ spin_unlock_irqrestore(ap->lock, flags);
+ if (do_resume) {
+ ret = scsi_resume_device(sdev);
+- if (ret == -EWOULDBLOCK)
++ if (ret == -EWOULDBLOCK) {
++ scsi_device_put(sdev);
+ goto unlock_scan;
++ }
+ dev->flags &= ~ATA_DFLAG_RESUMING;
+ }
+ ret = scsi_rescan_device(sdev);
--- /dev/null
+From 7d277a7a58578dd62fd546ddaef459ec24ccae36 Mon Sep 17 00:00:00 2001
+From: Andrey Vatoropin <a.vatoropin@crpt.ru>
+Date: Wed, 19 Nov 2025 10:51:12 +0000
+Subject: be2net: pass wrb_params in case of OS2BMC
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Andrey Vatoropin <a.vatoropin@crpt.ru>
+
+commit 7d277a7a58578dd62fd546ddaef459ec24ccae36 upstream.
+
+be_insert_vlan_in_pkt() is called with the wrb_params argument being NULL
+at be_send_pkt_to_bmc() call site. This may lead to dereferencing a NULL
+pointer when processing a workaround for specific packet, as commit
+bc0c3405abbb ("be2net: fix a Tx stall bug caused by a specific ipv6
+packet") states.
+
+The correct way would be to pass the wrb_params from be_xmit().
+
+Fixes: 760c295e0e8d ("be2net: Support for OS2BMC.")
+Cc: stable@vger.kernel.org
+Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
+Link: https://patch.msgid.link/20251119105015.194501-1-a.vatoropin@crpt.ru
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/emulex/benet/be_main.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/emulex/benet/be_main.c
++++ b/drivers/net/ethernet/emulex/benet/be_main.c
+@@ -1297,7 +1297,8 @@ static void be_xmit_flush(struct be_adap
+ (adapter->bmc_filt_mask & BMC_FILT_MULTICAST)
+
+ static bool be_send_pkt_to_bmc(struct be_adapter *adapter,
+- struct sk_buff **skb)
++ struct sk_buff **skb,
++ struct be_wrb_params *wrb_params)
+ {
+ struct ethhdr *eh = (struct ethhdr *)(*skb)->data;
+ bool os2bmc = false;
+@@ -1361,7 +1362,7 @@ done:
+ * to BMC, asic expects the vlan to be inline in the packet.
+ */
+ if (os2bmc)
+- *skb = be_insert_vlan_in_pkt(adapter, *skb, NULL);
++ *skb = be_insert_vlan_in_pkt(adapter, *skb, wrb_params);
+
+ return os2bmc;
+ }
+@@ -1388,7 +1389,7 @@ static netdev_tx_t be_xmit(struct sk_buf
+ /* if os2bmc is enabled and if the pkt is destined to bmc,
+ * enqueue the pkt a 2nd time with mgmt bit set.
+ */
+- if (be_send_pkt_to_bmc(adapter, &skb)) {
++ if (be_send_pkt_to_bmc(adapter, &skb, &wrb_params)) {
+ BE_WRB_F_SET(wrb_params.features, OS2BMC, 1);
+ wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
+ if (unlikely(!wrb_cnt))
--- /dev/null
+From f2c1f631630e01821fe4c3fdf6077bc7a8284f82 Mon Sep 17 00:00:00 2001
+From: Yongpeng Yang <yangyongpeng@xiaomi.com>
+Date: Tue, 4 Nov 2025 20:50:07 +0800
+Subject: exfat: check return value of sb_min_blocksize in exfat_read_boot_sector
+
+From: Yongpeng Yang <yangyongpeng@xiaomi.com>
+
+commit f2c1f631630e01821fe4c3fdf6077bc7a8284f82 upstream.
+
+sb_min_blocksize() may return 0. Check its return value to avoid
+accessing the filesystem super block when sb->s_blocksize is 0.
+
+Cc: stable@vger.kernel.org # v6.15
+Fixes: 719c1e1829166d ("exfat: add super block operations")
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
+Link: https://patch.msgid.link/20251104125009.2111925-3-yangyongpeng.storage@gmail.com
+Signed-off-by: Christian Brauner <brauner@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/exfat/super.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/fs/exfat/super.c
++++ b/fs/exfat/super.c
+@@ -425,7 +425,10 @@ static int exfat_read_boot_sector(struct
+ struct exfat_sb_info *sbi = EXFAT_SB(sb);
+
+ /* set block size to read super block */
+- sb_min_blocksize(sb, 512);
++ if (!sb_min_blocksize(sb, 512)) {
++ exfat_err(sb, "unable to set blocksize");
++ return -EINVAL;
++ }
+
+ /* read boot sector */
+ sbi->boot_bh = sb_bread(sb, 0);
--- /dev/null
+From beab067dbcff642243291fd528355d64c41dc3b2 Mon Sep 17 00:00:00 2001
+From: Zhang Heng <zhangheng@kylinos.cn>
+Date: Fri, 12 Sep 2025 20:38:18 +0800
+Subject: HID: quirks: work around VID/PID conflict for 0x4c4a/0x4155
+
+From: Zhang Heng <zhangheng@kylinos.cn>
+
+commit beab067dbcff642243291fd528355d64c41dc3b2 upstream.
+
+Based on available evidence, the USB ID 4c4a:4155 used by multiple
+devices has been attributed to Jieli. The commit 1a8953f4f774
+("HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY") affected touchscreen
+functionality. Added checks for manufacturer and serial number to
+maintain microphone compatibility, enabling both devices to function
+properly.
+
+[jkosina@suse.com: edit shortlog]
+Fixes: 1a8953f4f774 ("HID: Add IGNORE quirk for SMARTLINKTECHNOLOGY")
+Cc: stable@vger.kernel.org
+Tested-by: staffan.melin@oscillator.se
+Reviewed-by: Terry Junge <linuxhid@cosmicgizmosystems.com>
+Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
+Signed-off-by: Jiri Kosina <jkosina@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hid/hid-ids.h | 4 ++--
+ drivers/hid/hid-quirks.c | 13 ++++++++++++-
+ 2 files changed, 14 insertions(+), 3 deletions(-)
+
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -1460,7 +1460,7 @@
+ #define USB_VENDOR_ID_SIGNOTEC 0x2133
+ #define USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011 0x0018
+
+-#define USB_VENDOR_ID_SMARTLINKTECHNOLOGY 0x4c4a
+-#define USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 0x4155
++#define USB_VENDOR_ID_JIELI_SDK_DEFAULT 0x4c4a
++#define USB_DEVICE_ID_JIELI_SDK_4155 0x4155
+
+ #endif
+--- a/drivers/hid/hid-quirks.c
++++ b/drivers/hid/hid-quirks.c
+@@ -888,7 +888,6 @@ static const struct hid_device_id hid_ig
+ #endif
+ { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) },
+- { HID_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) },
+ { }
+ };
+
+@@ -1045,6 +1044,18 @@ bool hid_ignore(struct hid_device *hdev)
+ strlen(elan_acpi_id[i].id)))
+ return true;
+ break;
++ case USB_VENDOR_ID_JIELI_SDK_DEFAULT:
++ /*
++ * Multiple USB devices with identical IDs (mic & touchscreen).
++ * The touch screen requires hid core processing, but the
++ * microphone does not. They can be distinguished by manufacturer
++ * and serial number.
++ */
++ if (hdev->product == USB_DEVICE_ID_JIELI_SDK_4155 &&
++ strncmp(hdev->name, "SmartlinkTechnology", 19) == 0 &&
++ strncmp(hdev->uniq, "20201111000001", 14) == 0)
++ return true;
++ break;
+ }
+
+ if (hdev->type == HID_TYPE_USBMOUSE &&
--- /dev/null
+From 9f048fa487409e364cf866c957cf0b0d782ca5a3 Mon Sep 17 00:00:00 2001
+From: "Maciej W. Rozycki" <macro@orcam.me.uk>
+Date: Thu, 13 Nov 2025 05:21:10 +0000
+Subject: MIPS: mm: Prevent a TLB shutdown on initial uniquification
+
+From: Maciej W. Rozycki <macro@orcam.me.uk>
+
+commit 9f048fa487409e364cf866c957cf0b0d782ca5a3 upstream.
+
+Depending on the particular CPU implementation a TLB shutdown may occur
+if multiple matching entries are detected upon the execution of a TLBP
+or the TLBWI/TLBWR instructions. Given that we don't know what entries
+we have been handed we need to be very careful with the initial TLB
+setup and avoid all these instructions.
+
+Therefore read all the TLB entries one by one with the TLBR instruction,
+bypassing the content addressing logic, and truncate any large pages in
+place so as to avoid a case in the second step where an incoming entry
+for a large page at a lower address overlaps with a replacement entry
+chosen at another index. Then preinitialize the TLB using addresses
+outside our usual unique range and avoiding clashes with any entries
+received, before making the usual call to local_flush_tlb_all().
+
+This fixes (at least) R4x00 cores if TLBP hits multiple matching TLB
+entries (SGI IP22 PROM for examples sets up all TLBs to the same virtual
+address).
+
+Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
+Fixes: 35ad7e181541 ("MIPS: mm: tlb-r4k: Uniquify TLB entries on init")
+Cc: stable@vger.kernel.org
+Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
+Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com> # Boston I6400, M5150 sim
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/mips/mm/tlb-r4k.c | 102 ++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 64 insertions(+), 38 deletions(-)
+
+--- a/arch/mips/mm/tlb-r4k.c
++++ b/arch/mips/mm/tlb-r4k.c
+@@ -15,6 +15,7 @@
+ #include <linux/mm.h>
+ #include <linux/hugetlb.h>
+ #include <linux/export.h>
++#include <linux/sort.h>
+
+ #include <asm/cpu.h>
+ #include <asm/cpu-type.h>
+@@ -498,55 +499,79 @@ static int __init set_ntlb(char *str)
+
+ __setup("ntlb=", set_ntlb);
+
+-/* Initialise all TLB entries with unique values */
++
++/* Comparison function for EntryHi VPN fields. */
++static int r4k_vpn_cmp(const void *a, const void *b)
++{
++ long v = *(unsigned long *)a - *(unsigned long *)b;
++ int s = sizeof(long) > sizeof(int) ? sizeof(long) * 8 - 1: 0;
++ return s ? (v != 0) | v >> s : v;
++}
++
++/*
++ * Initialise all TLB entries with unique values that do not clash with
++ * what we have been handed over and what we'll be using ourselves.
++ */
+ static void r4k_tlb_uniquify(void)
+ {
+- int entry = num_wired_entries();
++ unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE];
++ int tlbsize = current_cpu_data.tlbsize;
++ int start = num_wired_entries();
++ unsigned long vpn_mask;
++ int cnt, ent, idx, i;
++
++ vpn_mask = GENMASK(cpu_vmbits - 1, 13);
++ vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31;
+
+ htw_stop();
+- write_c0_entrylo0(0);
+- write_c0_entrylo1(0);
+
+- while (entry < current_cpu_data.tlbsize) {
+- unsigned long asid_mask = cpu_asid_mask(¤t_cpu_data);
+- unsigned long asid = 0;
+- int idx;
++ for (i = start, cnt = 0; i < tlbsize; i++, cnt++) {
++ unsigned long vpn;
+
+- /* Skip wired MMID to make ginvt_mmid work */
+- if (cpu_has_mmid)
+- asid = MMID_KERNEL_WIRED + 1;
++ write_c0_index(i);
++ mtc0_tlbr_hazard();
++ tlb_read();
++ tlb_read_hazard();
++ vpn = read_c0_entryhi();
++ vpn &= vpn_mask & PAGE_MASK;
++ tlb_vpns[cnt] = vpn;
+
+- /* Check for match before using UNIQUE_ENTRYHI */
+- do {
+- if (cpu_has_mmid) {
+- write_c0_memorymapid(asid);
+- write_c0_entryhi(UNIQUE_ENTRYHI(entry));
+- } else {
+- write_c0_entryhi(UNIQUE_ENTRYHI(entry) | asid);
+- }
+- mtc0_tlbw_hazard();
+- tlb_probe();
+- tlb_probe_hazard();
+- idx = read_c0_index();
+- /* No match or match is on current entry */
+- if (idx < 0 || idx == entry)
+- break;
+- /*
+- * If we hit a match, we need to try again with
+- * a different ASID.
+- */
+- asid++;
+- } while (asid < asid_mask);
+-
+- if (idx >= 0 && idx != entry)
+- panic("Unable to uniquify TLB entry %d", idx);
+-
+- write_c0_index(entry);
++ /* Prevent any large pages from overlapping regular ones. */
++ write_c0_pagemask(read_c0_pagemask() & PM_DEFAULT_MASK);
+ mtc0_tlbw_hazard();
+ tlb_write_indexed();
+- entry++;
++ tlbw_use_hazard();
+ }
+
++ sort(tlb_vpns, cnt, sizeof(tlb_vpns[0]), r4k_vpn_cmp, NULL);
++
++ write_c0_pagemask(PM_DEFAULT_MASK);
++ write_c0_entrylo0(0);
++ write_c0_entrylo1(0);
++
++ idx = 0;
++ ent = tlbsize;
++ for (i = start; i < tlbsize; i++)
++ while (1) {
++ unsigned long entryhi, vpn;
++
++ entryhi = UNIQUE_ENTRYHI(ent);
++ vpn = entryhi & vpn_mask & PAGE_MASK;
++
++ if (idx >= cnt || vpn < tlb_vpns[idx]) {
++ write_c0_entryhi(entryhi);
++ write_c0_index(i);
++ mtc0_tlbw_hazard();
++ tlb_write_indexed();
++ ent++;
++ break;
++ } else if (vpn == tlb_vpns[idx]) {
++ ent++;
++ } else {
++ idx++;
++ }
++ }
++
+ tlbw_use_hazard();
+ htw_start();
+ flush_micro_tlb();
+@@ -592,6 +617,7 @@ static void r4k_tlb_configure(void)
+
+ /* From this point on the ARC firmware is dead. */
+ r4k_tlb_uniquify();
++ local_flush_tlb_all();
+
+ /* Did I tell you that ARC SUCKS? */
+ }
--- /dev/null
+From fbade4bd08ba52cbc74a71c4e86e736f059f99f7 Mon Sep 17 00:00:00 2001
+From: Jiayuan Chen <jiayuan.chen@linux.dev>
+Date: Tue, 11 Nov 2025 14:02:50 +0800
+Subject: mptcp: Disallow MPTCP subflows from sockmap
+
+From: Jiayuan Chen <jiayuan.chen@linux.dev>
+
+commit fbade4bd08ba52cbc74a71c4e86e736f059f99f7 upstream.
+
+The sockmap feature allows bpf syscall from userspace, or based on bpf
+sockops, replacing the sk_prot of sockets during protocol stack processing
+with sockmap's custom read/write interfaces.
+'''
+tcp_rcv_state_process()
+ subflow_syn_recv_sock()
+ tcp_init_transfer(BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB)
+ bpf_skops_established <== sockops
+ bpf_sock_map_update(sk) <== call bpf helper
+ tcp_bpf_update_proto() <== update sk_prot
+'''
+Consider two scenarios:
+
+1. When the server has MPTCP enabled and the client also requests MPTCP,
+ the sk passed to the BPF program is a subflow sk. Since subflows only
+ handle partial data, replacing their sk_prot is meaningless and will
+ cause traffic disruption.
+
+2. When the server has MPTCP enabled but the client sends a TCP SYN
+ without MPTCP, subflow_syn_recv_sock() performs a fallback on the
+ subflow, replacing the subflow sk's sk_prot with the native sk_prot.
+ '''
+ subflow_ulp_fallback()
+ subflow_drop_ctx()
+ mptcp_subflow_ops_undo_override()
+ '''
+ Subsequently, accept::mptcp_stream_accept::mptcp_fallback_tcp_ops()
+ converts the subflow to plain TCP.
+
+For the first case, we should prevent it from being combined with sockmap
+by setting sk_prot->psock_update_sk_prot to NULL, which will be blocked by
+sockmap's own flow.
+
+For the second case, since subflow_syn_recv_sock() has already restored
+sk_prot to native tcp_prot/tcpv6_prot, no further action is needed.
+
+Fixes: cec37a6e41aa ("mptcp: Handle MP_CAPABLE options for outgoing connections")
+Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
+Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
+Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Cc: <stable@vger.kernel.org>
+Link: https://patch.msgid.link/20251111060307.194196-2-jiayuan.chen@linux.dev
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/mptcp/subflow.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/net/mptcp/subflow.c
++++ b/net/mptcp/subflow.c
+@@ -1997,6 +1997,10 @@ void __init mptcp_subflow_init(void)
+ tcp_prot_override = tcp_prot;
+ tcp_prot_override.release_cb = tcp_release_cb_override;
+ tcp_prot_override.diag_destroy = tcp_abort_override;
++#ifdef CONFIG_BPF_SYSCALL
++ /* Disable sockmap processing for subflows */
++ tcp_prot_override.psock_update_sk_prot = NULL;
++#endif
+
+ #if IS_ENABLED(CONFIG_MPTCP_IPV6)
+ /* In struct mptcp_subflow_request_sock, we assume the TCP request sock
+@@ -2033,6 +2037,10 @@ void __init mptcp_subflow_init(void)
+ tcpv6_prot_override = tcpv6_prot;
+ tcpv6_prot_override.release_cb = tcp_release_cb_override;
+ tcpv6_prot_override.diag_destroy = tcp_abort_override;
++#ifdef CONFIG_BPF_SYSCALL
++ /* Disable sockmap processing for subflows */
++ tcpv6_prot_override.psock_update_sk_prot = NULL;
++#endif
+ #endif
+
+ mptcp_diag_subflow_init(&subflow_ulp_ops);
--- /dev/null
+From 5c56bf214af85ca042bf97f8584aab2151035840 Mon Sep 17 00:00:00 2001
+From: Niravkumar L Rabara <niravkumarlaxmidas.rabara@altera.com>
+Date: Thu, 23 Oct 2025 11:32:01 +0800
+Subject: mtd: rawnand: cadence: fix DMA device NULL pointer dereference
+
+From: Niravkumar L Rabara <niravkumarlaxmidas.rabara@altera.com>
+
+commit 5c56bf214af85ca042bf97f8584aab2151035840 upstream.
+
+The DMA device pointer `dma_dev` was being dereferenced before ensuring
+that `cdns_ctrl->dmac` is properly initialized.
+
+Move the assignment of `dma_dev` after successfully acquiring the DMA
+channel to ensure the pointer is valid before use.
+
+Fixes: d76d22b5096c ("mtd: rawnand: cadence: use dma_map_resource for sdma address")
+Cc: stable@vger.kernel.org
+Signed-off-by: Niravkumar L Rabara <niravkumarlaxmidas.rabara@altera.com>
+Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mtd/nand/raw/cadence-nand-controller.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/mtd/nand/raw/cadence-nand-controller.c
++++ b/drivers/mtd/nand/raw/cadence-nand-controller.c
+@@ -2830,7 +2830,7 @@ cadence_nand_irq_cleanup(int irqnum, str
+ static int cadence_nand_init(struct cdns_nand_ctrl *cdns_ctrl)
+ {
+ dma_cap_mask_t mask;
+- struct dma_device *dma_dev = cdns_ctrl->dmac->device;
++ struct dma_device *dma_dev;
+ int ret;
+
+ cdns_ctrl->cdma_desc = dma_alloc_coherent(cdns_ctrl->dev,
+@@ -2874,6 +2874,7 @@ static int cadence_nand_init(struct cdns
+ }
+ }
+
++ dma_dev = cdns_ctrl->dmac->device;
+ cdns_ctrl->io.iova_dma = dma_map_resource(dma_dev->dev, cdns_ctrl->io.dma,
+ cdns_ctrl->io.size,
+ DMA_BIDIRECTIONAL, 0);
--- /dev/null
+From e4185bed738da755b191aa3f2e16e8b48450e1b8 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Tue, 30 Sep 2025 15:32:34 +0300
+Subject: mtdchar: fix integer overflow in read/write ioctls
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+commit e4185bed738da755b191aa3f2e16e8b48450e1b8 upstream.
+
+The "req.start" and "req.len" variables are u64 values that come from the
+user at the start of the function. We mask away the high 32 bits of
+"req.len" so that's capped at U32_MAX but the "req.start" variable can go
+up to U64_MAX which means that the addition can still integer overflow.
+
+Use check_add_overflow() to fix this bug.
+
+Fixes: 095bb6e44eb1 ("mtdchar: add MEMREAD ioctl")
+Fixes: 6420ac0af95d ("mtdchar: prevent unbounded allocation in MEMWRITE ioctl")
+Cc: stable@vger.kernel.org
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mtd/mtdchar.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/mtd/mtdchar.c
++++ b/drivers/mtd/mtdchar.c
+@@ -599,6 +599,7 @@ mtdchar_write_ioctl(struct mtd_info *mtd
+ uint8_t *datbuf = NULL, *oobbuf = NULL;
+ size_t datbuf_len, oobbuf_len;
+ int ret = 0;
++ u64 end;
+
+ if (copy_from_user(&req, argp, sizeof(req)))
+ return -EFAULT;
+@@ -618,7 +619,7 @@ mtdchar_write_ioctl(struct mtd_info *mtd
+ req.len &= 0xffffffff;
+ req.ooblen &= 0xffffffff;
+
+- if (req.start + req.len > mtd->size)
++ if (check_add_overflow(req.start, req.len, &end) || end > mtd->size)
+ return -EINVAL;
+
+ datbuf_len = min_t(size_t, req.len, mtd->erasesize);
+@@ -698,6 +699,7 @@ mtdchar_read_ioctl(struct mtd_info *mtd,
+ size_t datbuf_len, oobbuf_len;
+ size_t orig_len, orig_ooblen;
+ int ret = 0;
++ u64 end;
+
+ if (copy_from_user(&req, argp, sizeof(req)))
+ return -EFAULT;
+@@ -724,7 +726,7 @@ mtdchar_read_ioctl(struct mtd_info *mtd,
+ req.len &= 0xffffffff;
+ req.ooblen &= 0xffffffff;
+
+- if (req.start + req.len > mtd->size) {
++ if (check_add_overflow(req.start, req.len, &end) || end > mtd->size) {
+ ret = -EINVAL;
+ goto out;
+ }
--- /dev/null
+From 3ceb6ac2116ecda1c5d779bb73271479e70fccb4 Mon Sep 17 00:00:00 2001
+From: Oleksij Rempel <o.rempel@pengutronix.de>
+Date: Fri, 14 Nov 2025 10:09:51 +0100
+Subject: net: dsa: microchip: lan937x: Fix RGMII delay tuning
+
+From: Oleksij Rempel <o.rempel@pengutronix.de>
+
+commit 3ceb6ac2116ecda1c5d779bb73271479e70fccb4 upstream.
+
+Correct RGMII delay application logic in lan937x_set_tune_adj().
+
+The function was missing `data16 &= ~PORT_TUNE_ADJ` before setting the
+new delay value. This caused the new value to be bitwise-OR'd with the
+existing PORT_TUNE_ADJ field instead of replacing it.
+
+For example, when setting the RGMII 2 TX delay on port 4, the
+intended TUNE_ADJUST value of 0 (RGMII_2_TX_DELAY_2NS) was
+incorrectly OR'd with the default 0x1B (from register value 0xDA3),
+leaving the delay at the wrong setting.
+
+This patch adds the missing mask to clear the field, ensuring the
+correct delay value is written. Physical measurements on the RGMII TX
+lines confirm the fix, showing the delay changing from ~1ns (before
+change) to ~2ns.
+
+While testing on i.MX 8MP showed this was within the platform's timing
+tolerance, it did not match the intended hardware-characterized value.
+
+Fixes: b19ac41faa3f ("net: dsa: microchip: apply rgmii tx and rx delay in phylink mac config")
+Cc: stable@vger.kernel.org
+Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
+Link: https://patch.msgid.link/20251114090951.4057261-1-o.rempel@pengutronix.de
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/dsa/microchip/lan937x_main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/dsa/microchip/lan937x_main.c
++++ b/drivers/net/dsa/microchip/lan937x_main.c
+@@ -328,6 +328,7 @@ static void lan937x_set_tune_adj(struct
+ ksz_pread16(dev, port, reg, &data16);
+
+ /* Update tune Adjust */
++ data16 &= ~PORT_TUNE_ADJ;
+ data16 |= FIELD_PREP(PORT_TUNE_ADJ, val);
+ ksz_pwrite16(dev, port, reg, data16);
+
net-sched-act_connmark-handle-errno-on-tcf_idr_check_alloc.patch
net-mlx5e-do-not-update-sbcm-when-prio2buffer-command-is-invalid.patch
net-mlx5e-preserve-shared-buffer-capacity-during-headroom-updates.patch
+timers-fix-null-function-pointer-race-in-timer_shutdown_sync.patch
+hid-quirks-work-around-vid-pid-conflict-for-0x4c4a-0x4155.patch
+mtd-rawnand-cadence-fix-dma-device-null-pointer-dereference.patch
+mtdchar-fix-integer-overflow-in-read-write-ioctls.patch
+exfat-check-return-value-of-sb_min_blocksize-in-exfat_read_boot_sector.patch
+mptcp-disallow-mptcp-subflows-from-sockmap.patch
+mips-mm-prevent-a-tlb-shutdown-on-initial-uniquification.patch
+ata-libata-scsi-add-missing-scsi_device_put-in-ata_scsi_dev_rescan.patch
+be2net-pass-wrb_params-in-case-of-os2bmc.patch
+net-dsa-microchip-lan937x-fix-rgmii-delay-tuning.patch
--- /dev/null
+From 20739af07383e6eb1ec59dcd70b72ebfa9ac362c Mon Sep 17 00:00:00 2001
+From: Yipeng Zou <zouyipeng@huawei.com>
+Date: Sat, 22 Nov 2025 09:39:42 +0000
+Subject: timers: Fix NULL function pointer race in timer_shutdown_sync()
+
+From: Yipeng Zou <zouyipeng@huawei.com>
+
+commit 20739af07383e6eb1ec59dcd70b72ebfa9ac362c upstream.
+
+There is a race condition between timer_shutdown_sync() and timer
+expiration that can lead to hitting a WARN_ON in expire_timers().
+
+The issue occurs when timer_shutdown_sync() clears the timer function
+to NULL while the timer is still running on another CPU. The race
+scenario looks like this:
+
+CPU0 CPU1
+ <SOFTIRQ>
+ lock_timer_base()
+ expire_timers()
+ base->running_timer = timer;
+ unlock_timer_base()
+ [call_timer_fn enter]
+ mod_timer()
+ ...
+timer_shutdown_sync()
+lock_timer_base()
+// For now, will not detach the timer but only clear its function to NULL
+if (base->running_timer != timer)
+ ret = detach_if_pending(timer, base, true);
+if (shutdown)
+ timer->function = NULL;
+unlock_timer_base()
+ [call_timer_fn exit]
+ lock_timer_base()
+ base->running_timer = NULL;
+ unlock_timer_base()
+ ...
+ // Now timer is pending while its function set to NULL.
+ // next timer trigger
+ <SOFTIRQ>
+ expire_timers()
+ WARN_ON_ONCE(!fn) // hit
+ ...
+lock_timer_base()
+// Now timer will detach
+if (base->running_timer != timer)
+ ret = detach_if_pending(timer, base, true);
+if (shutdown)
+ timer->function = NULL;
+unlock_timer_base()
+
+The problem is that timer_shutdown_sync() clears the timer function
+regardless of whether the timer is currently running. This can leave a
+pending timer with a NULL function pointer, which triggers the
+WARN_ON_ONCE(!fn) check in expire_timers().
+
+Fix this by only clearing the timer function when actually detaching the
+timer. If the timer is running, leave the function pointer intact, which is
+safe because the timer will be properly detached when it finishes running.
+
+Fixes: 0cc04e80458a ("timers: Add shutdown mechanism to the internal functions")
+Signed-off-by: Yipeng Zou <zouyipeng@huawei.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: stable@vger.kernel.org
+Link: https://patch.msgid.link/20251122093942.301559-1-zouyipeng@huawei.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/time/timer.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/kernel/time/timer.c
++++ b/kernel/time/timer.c
+@@ -1413,10 +1413,11 @@ static int __try_to_del_timer_sync(struc
+
+ base = lock_timer_base(timer, &flags);
+
+- if (base->running_timer != timer)
++ if (base->running_timer != timer) {
+ ret = detach_if_pending(timer, base, true);
+- if (shutdown)
+- timer->function = NULL;
++ if (shutdown)
++ timer->function = NULL;
++ }
+
+ raw_spin_unlock_irqrestore(&base->lock, flags);
+